api.request.input and param filtering
Nobody has claimed this yet.
- Dominant language
- Ruby
- Stars
- 10k
- Forks
- 1.2k
- Avg merge
- 14h 38m
- Merged PRs (30d)
- 92
Description
Rails' filter_parameters system is used by e.g. Rails logging and error notification APIs like Airbrake to avoid sensitive information leaking out. It works by running over a hash and overwriting it for certain keys. However, Grape puts the entire request body in env['api.request.input'] as a string, which means the param filtering doesn't operate on it. This can lead to e.g. plaintext passwords getting logged in error catchers.
This can be solved by adding 'api.request.input' to filter_parameters in Rails application configuration. Should I adapt the documentation to warn people about this, or should we look for other ways to avoid this behaviour?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing Rails' filter_parameters handling and how Grape populates env['api.request.input']; no repository file or test is named. Resolve whether the intended outcome is a documentation warning or a code-level filtering change, then validate the chosen behavior against error logging and sensitive request data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rails, ruby
- Domain
- api, backend, security
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100