Skip to content

Conversation

erik-krogh
Copy link
Contributor

@erik-krogh erik-krogh commented Apr 20, 2022

I did an experiment to revert the cached stages pattern.
That gave a whole bunch of QL-for-QL warnings from ql/abstract-class-import.

These warnings are caused by us having sanitizer-guards that were defined in Xss.qll.

I moved things around, including refactoring the old Xss.qll where I moved things out into Query.qll/Customizations.qll files so they match the other queries.
(Turns out the js/html-constructed-from-input query relied on the previous behavior 🙀).


The change in results for ATM is caused by: 76bf8de
The results generally look better (the majority is removal of FPs).
This PR only affects the XSS queries, but the changed ATM results are for TaintedPath.
So the results seem to be a bug caused by importing too many classes.
So I think we can conclude that this PR is a bug-fix for ATM.


The evaluation looks good.
We gained one new result. Which is caused by some barrier-guards no longer falsely limiting the flow.
Also a slight performance improvement 🚀


I also made some small drive-by fixes of ql/abstract-class-import to remove some benign results.

@erik-krogh erik-krogh added the Awaiting evaluation Do not merge yet, this PR is waiting for an evaluation to finish label Apr 20, 2022
@github-actions github-actions bot added the JS label Apr 20, 2022
@erik-krogh erik-krogh force-pushed the jsAbstractBi branch 2 times, most recently from f6d816a to d54b223 Compare April 20, 2022 12:50
@erik-krogh erik-krogh removed the Awaiting evaluation Do not merge yet, this PR is waiting for an evaluation to finish label Apr 20, 2022
@erik-krogh erik-krogh marked this pull request as ready for review April 20, 2022 21:34
@erik-krogh erik-krogh requested a review from a team as a code owner April 20, 2022 21:34
@erik-krogh erik-krogh requested a review from a team April 20, 2022 21:34
@erik-krogh erik-krogh requested a review from a team as a code owner April 20, 2022 21:34
@erik-krogh erik-krogh changed the title JS: fix ql/abstract-class-import JS: don't initialize sanitizer-guards in the standard library Apr 20, 2022
Copy link
Contributor

@asgerf asgerf left a comment

Choose a reason for hiding this comment

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

Awesome work! 💪

* A sanitizer that blocks the `PrefixString` label when the start of the string is being tested as being of a particular prefix.
*/
abstract class PrefixStringSanitizer extends TaintTracking::SanitizerGuardNode,
TaintTracking::LabeledSanitizerGuardNode instanceof StringOps::StartsWith {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a need to extend both SanitizerGuardNode and LabeledSanitizerGuardNode?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Probably 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.

Yep, the tests still pass.

erik-krogh and others added 3 commits April 21, 2022 09:09
Co-authored-by: Asger F <asgerf@github.com>
Co-authored-by: Asger F <asgerf@github.com>
@erik-krogh erik-krogh requested a review from asgerf April 26, 2022 10:21
Copy link
Contributor

@henrymercer henrymercer left a comment

Choose a reason for hiding this comment

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

ML-powered queries 👍

@TomBolton
Copy link
Contributor

@henrymercer how do feel if we merge this PR? I would like to use the merge commit on main to start preparing a PR to update the QL SHAs in backend (including the worsening commits)

Copy link
Contributor

@asgerf asgerf left a comment

Choose a reason for hiding this comment

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

Sorry, I guess we were waiting for me to review again. Thanks for addressing my comments @erik-krogh, LGTM 👍

@erik-krogh erik-krogh merged commit b74d1fd into github:main Apr 29, 2022
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.

4 participants