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

Apply rails 3.2 patch for activemodel attribute access #47509

Merged
merged 1 commit into from Feb 27, 2023

Conversation

rtreffer
Copy link

Motivation / Background

This Pull Request has been created because the fix for CVE-2013-0276 was never applied fully to Rails 4 and later.
It is a cherry-pick adjusted for the current state of the code to give proper authorship credits.

Original commit:

Fix issue with attr_protected where malformed input could circumvent protection

Fixes: CVE-2013-0276

Detail

This Pull Request changes the attribute matching in activemodel. Newlines will now be seen as part of the attribute name, thus making injections harder.

Additional information

This was originally easy to exploit but the switch to strong parameters should make it a non-issue in most cases.

Checklist

Before submitting the PR make sure the following are checked:

  • This Pull Request is related to one change. Changes that are unrelated should be opened in separate PRs.
  • Commit message has a detailed description of what changed and why. If this PR fixes a related issue include it in the commit message. Ex: [Fix #issue-number]
  • Tests are added or updated if you fix a bug or add a feature.
  • CHANGELOG files are updated for the changed libraries if there is a behavior change or additional feature. Minor bug fixes and documentation changes should not be included.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants