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
Hi, I ran into an interesting issue the other day when debugging an ugly response from Grape when sending a request with missing parameters to one of our endpoints.
Here's a stripped down version of the V1::Endpoints::Base definition:
You'll notice that the error! call was mistakenly placed on the first line instead of the last line and since return was omitted, this method will return the result of Bugsnag#notify, which is nil. This is obviously a bug on our end, but it causes the request to fail with a 500 and returns this full stack trace to the requestor:
IMO, there should be some validation of the return values of exception handlers when they're called by Grape::Middleware::Error#exec_handler to make sure the result is an error response since the status, headers, and body are passed directly back up to Rack. At best this is a fairly baffling message for a simple error, at worst it's a security vulnerability since this exposes which libraries a service is using along with their exact versions.
Please let me know if there's any other information I can provide.
The text was updated successfully, but these errors were encountered:
Hi, I ran into an interesting issue the other day when debugging an ugly response from Grape when sending a request with missing parameters to one of our endpoints.
Here's a stripped down version of the
V1::Endpoints::Base
definition:You'll notice that the
error!
call was mistakenly placed on the first line instead of the last line and sincereturn
was omitted, this method will return the result ofBugsnag#notify
, which isnil
. This is obviously a bug on our end, but it causes the request to fail with a 500 and returns this full stack trace to the requestor:IMO, there should be some validation of the return values of exception handlers when they're called by
Grape::Middleware::Error#exec_handler
to make sure the result is an error response since the status, headers, and body are passed directly back up to Rack. At best this is a fairly baffling message for a simple error, at worst it's a security vulnerability since this exposes which libraries a service is using along with their exact versions.Please let me know if there's any other information I can provide.
The text was updated successfully, but these errors were encountered: