Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Grape::Entity leaks @options and other internals when presented without a formatter #249

Closed
dblock opened this issue Nov 20, 2016 · 0 comments
Labels

Comments

@dblock
Copy link
Member

dblock commented Nov 20, 2016

When presented without a formatter a Grape::Entity gets serialized with all its internals, including @options. This doesn't appear to leak any sensitive information most of the time, but YMMV as the rack app, session, request objects and ActiveRecord internals come along.

It's a nasty side effect of adding something like content_type :csv, 'text/csv' and not having a general formatter :csv, ... that catches everything and calls, for example, to_csv. Entities by default support to_xml and to_json, but nothing else.

Complete example in https://gist.github.com/dblock/5b49741468efd5b6a7d6828167d47a65.

@dblock dblock added the bug label Nov 20, 2016
dblock added a commit to dblock/grape-entity that referenced this issue Nov 20, 2016
dblock added a commit to dblock/grape-entity that referenced this issue Nov 20, 2016
dblock added a commit to dblock/grape-entity that referenced this issue Nov 20, 2016
LeFnord pushed a commit that referenced this issue Nov 20, 2016
Fix #249: leaking of options and internals in default serialization.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant