-
Notifications
You must be signed in to change notification settings - Fork 0
Setup Angular Rails XSS Escaping #1
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
Conversation
d8eca19
to
de103b2
Compare
@claudioclutter for review - integration with specs is here: https://github.com/clutter/clutter-platform/pull/3570 |
aa79c88
to
f9e9862
Compare
spec/angular_rails_xss_spec.rb
Outdated
expect(escaped).to eql('{{"\\{\\{"{{"\\}\\}"}}2+3{{"\\}\\}"}}') | ||
end | ||
|
||
it 'also does the normal CG.escapeHTML to work with other escapes' do |
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.
@ksylvest Minor typo: CG
vs CGI
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.
Thanks - I also hate the new Macbook keyboard...
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.
Fixup: c0b9742
README.md
Outdated
``` | ||
## Dependencies | ||
|
||
WT is tested with Rails 5.2.0 and Ruby 2.5.1. |
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.
@ksylvest WT
here
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.
Also… we are on Rails 5.1, so I guess it's tested there too 😊
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.
Fixup: c0b9742 (technically not tested on 5.2!)
@claudioclutter sorry - I realized I assigned this a bit early. The XSS replacement had a bug with quote escaping - so opted to go with a $root variable and define it. This fixup has the changes: a717f91 |
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.
security > beauty
😊
This library patches CGI.escapeHTML to replace {{ and }} with escaped versions. The reason for doing this is user generated input (i.e. form submissions, active record interpolation, etc.) can easily be spoofed to contain Angular interoperable blocks “{{2 + 3}}”. The style of injection might lead to XSS attacks.
This library patches CGI.escapeHTML to replace {{ and }} with escaped versions. The reason for doing this is user generated input (i.e. form submissions, active record interpolation, etc.) can easily be spoofed to contain Angular interoperable blocks “{{2 + 3}}”. The style of injection might lead to XSS attacks.