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

Strip null bytes from Location header #5456

Merged
merged 1 commit into from
Mar 15, 2012
Merged

Strip null bytes from Location header #5456

merged 1 commit into from
Mar 15, 2012

Conversation

brianmario
Copy link
Contributor

This strips null bytes off of the Location header in addition to \r\n which are already being stripped.

This is in response to a recent nasty security vulnerability in nginx. I figure it's probably easier for people to get this patch in their Rails applications than it is for them to get nginx upgraded in their infrastructure - which may or may not even be managed by them.

I'd like to get this into all supported Rails versions, not sure if this patch will apply cleanly to 3.1 or 3.0 - let me know if not and I'll send some others.

add tests for stripping \r\n chars since that's already happening
tenderlove added a commit that referenced this pull request Mar 15, 2012
Strip null bytes from Location header
@tenderlove tenderlove merged commit a7dee1a into rails:master Mar 15, 2012
tenderlove added a commit that referenced this pull request Mar 15, 2012
Strip null bytes from Location header
tenderlove added a commit that referenced this pull request Mar 15, 2012
Strip null bytes from Location header
tenderlove added a commit that referenced this pull request Mar 15, 2012
Strip null bytes from Location header
Conflicts:

	actionpack/test/controller/redirect_test.rb
end

def test_redirect_with_null_bytes
get :redirect_with_header_break

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, I think this should read redirect_with_null_bytes instead, not?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gah, yep :(

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

another PR plz? ❤️

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❤️❤️❤️❤️❤️❤️❤️❤️

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

Successfully merging this pull request may close these issues.

None yet

3 participants