You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description and expected behavior
The ZenStackMiddleware from @zenstackhq/server/express should not throw an unhandled error if malformed JSON is received in a query parameter.
When using ZenStackMiddleware for express, the generated openapi router does not wrap calls to JSON.parse in a try/catch, which causes an express server to completely crash unless the entire middleware is wrapped in a try/catch.
Thus if using the middleware out of the box, the server can be crashed by doing things such as this:
GET <host>/openapi/user/findUnique?q={"where":"""} or any sort of string for q that would cause JSON.parse to error.
Environment (please complete the following information):