-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
[23073] Add Angular expression escaping #4536
[23073] Add Angular expression escaping #4536
Conversation
Them gem patches Rails XSS protection methods with a replacement of `{{` strings with `{{ DOUBLE_LEFT_CURLY_BRACE }} `. `DOUBLE_LEFT_CURLY_BRACE` is defined by Angular to return `{{`, so we actually do execute the interpolation, but only to return the original string. More information: https://github.com/opf/rails-angular-xss angular/angular.js#5601
I've prepared a stage to preview changes. Open stage or view logs. |
e644177
to
4f67e1c
Compare
4f67e1c
to
43599a9
Compare
@@ -95,6 +95,9 @@ gem 'rack-protection', git: 'https://github.com/finnlabs/rack-protection.git', r | |||
# https://github.com/kickstarter/rack-attack | |||
gem 'rack-attack' | |||
|
|||
# Patch Rails HTML whitelisting for Angular curly braces | |||
gem 'rails-angular-xss', github: 'opf/rails-angular-xss' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I seem to remember you saying that this can be removed once we have Angular 1.5 in place. If that is so, I'd like a commit in here so that we remove this gem once we no longer need it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll still need the Rails part, since the escaping issue remains for all eternity
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds like a long time :(
There are some parts of the update to gemfile.lock that are not strictly necessary for this change but they probably can't hurt either. |
This PR adds
rails-angular-xss
, our gem forked fromangular_xss
for Rails 4.2.The gem patches Rails XSS protection methods with a replacement of
{{
strings with
{{ DOUBLE_LEFT_CURLY_BRACE }}
.DOUBLE_LEFT_CURLY_BRACE
is defined by Angular to return{{
, so weactually do execute the interpolation, but only to return the original
string.
More information:
https://github.com/opf/rails-angular-xss
angular/angular.js#5601