-
Notifications
You must be signed in to change notification settings - Fork 1.8k
RB: simplify html_safe modeling #10840
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
Some of the results for rails look a bit odd to me. I'm struggling to figure out where the sources are coming from in some cases. I would expect that, outside of test code, rails would not have any ORM sources, as it doesn't define any concrete |
I haven't looked into the rails/rails results, but a lot of the spurious results for class User < ApplicationRecord
attr_reader :some_attribute, :some_other_attribute
...
end I think we can usually assume that a call to |
The spurious results (at least some of them) seemed to be from this additional-flow-step. The use of the |
A new evaluation looks good. |
One possibility is to make a subsequent |
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 think that the html_safe
related changes here make sense.
The changes to flow through OrmTracking
also seem worthwhile for the large performance improvement. That being said, there is potential to lose legitimate results here. The results that we lose in DCA are (probably) FPs, in that they seem to access sanitized versions of fields. It's probably infeasible to actually verify that these fields are properly sanitized in practice - I guess we would have to check that there don't exist any writes to this field (anywhere in the program) where unsanitized data can flow to.
On a separate note, I'm working on a change to avoid considering attribute accesses as potential ActiveRecord
field accesses which should reduce the FP rate for rb/stored-xss
a bit. It looks like most of these FPs from an earlier evaluation have already gone as a result of the changes to OrmTracking
in this PR.
CVE-2020-16254: Recognizes the sink.
The idea is that a
.html_safe
call is an XSS sink in any context.An evaluation looks OK.
Performance is neutral, and there are some new results.
But could someone with more Ruby experience confirm that the new results look OK?