Skip to content

JavaScript: Teach IncompleteSanitization to recognize incomplete URI {en,de}coding. #43

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

Merged
merged 1 commit into from
Aug 10, 2018

Conversation

xiemaisi
Copy link

Finds a good number of new results, most of which are obviously true positives.

Copy link
Contributor

@asger-semmle asger-semmle left a comment

Choose a reason for hiding this comment

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

LGTM, with an optional remark

m.regexpMatch(urlEscapePattern)
or
// URL encoder
repl.getArgument(1).getStringValue().regexpMatch(urlEscapePattern)
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a real problem in this case, but it does bother me a bit that m isn't bound in the last case. It's not that obvious that there is no cartesian product here.

Copy link
Author

Choose a reason for hiding this comment

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

I can pull it out of the exists if you like and add and exists(getAMatchedString(old)) instead (that bit is important to avoid false positives from cases where we cannot analyse old).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah right, if the exists matters then let's keep it like this.

@xiemaisi xiemaisi added the JS label Aug 10, 2018
@semmle-qlci semmle-qlci merged commit 2478c6e into github:master Aug 10, 2018
@xiemaisi xiemaisi deleted the js/odasa-7275 branch August 13, 2018 09:17
aibaars pushed a commit that referenced this pull request Oct 14, 2021
smowton pushed a commit to smowton/codeql that referenced this pull request Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants