Skip to content

Conversation

@asger-semmle
Copy link
Contributor

Adds HtmlSanitizerCall, which models a call to a function whose purpose is to sanitize HTML.

CodeInjection has been updated to use the HtmlSanitizerCall class for additional taint steps. Unilke the previous version of this PR, no other queries are affected, since it cost more than expected.

I ran CodeInjection on default slugs to force evaluation of HtmlSanitizerCall. The performance results are noisy but after re-running the slowest bunch it looks okay.

@max you had some concerns about the name-based matching in the standard library. We could move that part back into CodeInjection if you prefer.

@asger-semmle asger-semmle requested a review from a team as a code owner August 10, 2018 10:38
Copy link

@xiemaisi xiemaisi left a comment

Choose a reason for hiding this comment

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

LGTM, but perhaps could do with a change note. The name based matching is probably fine; it's no worse than what we do for sensitive expressions.

abstract DataFlow::Node getInput();
}

private class DefaultHtmlSanitizerCall extends HtmlSanitizerCall {

Choose a reason for hiding this comment

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

May be worth adding a comment (even though it's private), explaining that this models popular npm packages as well as home-made sanitizers.

@asger-semmle
Copy link
Contributor Author

Addressed comments and rebased to avoid conflict in the change log.

Copy link

@xiemaisi xiemaisi left a comment

Choose a reason for hiding this comment

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

LGTM

@xiemaisi xiemaisi added the JS label Aug 13, 2018
@semmle-qlci semmle-qlci merged commit c0fe0a1 into github:master Aug 13, 2018
aibaars pushed a commit that referenced this pull request Oct 14, 2021
Add `unique` wrapper to `AstNode::getParent()`
smowton pushed a commit to smowton/codeql that referenced this pull request Oct 28, 2021
Change build to simplify sembuild integration
dbartol pushed a commit that referenced this pull request Dec 18, 2024
Add models for composite actions and reusable workflows sinks
dbartol pushed a commit that referenced this pull request Dec 18, 2024
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