mirror of
https://github.com/github/codeql.git
synced 2025-12-21 19:26:31 +01:00
remove nunjucks template URLs from the target-blank query
This commit is contained in:
@@ -43,8 +43,8 @@ predicate hasDynamicHrefHostAttributeValue(DOM::ElementDefinition elem) {
|
||||
url.regexpMatch(Templating::getDelimiterMatchingRegexpWithPrefix("[^?#]*")) and
|
||||
// ... that does not start with a fixed host or a relative path (common formats)
|
||||
not url.regexpMatch("(?i)((https?:)?//)?[-a-z0-9.]*/.*") and
|
||||
// .. that is not a call to `url_for` in a Flask application
|
||||
not url.regexpMatch("\\{\\{\\s*url_for.*")
|
||||
// .. that is not a call to `url_for` in a Flask / nunjucks application
|
||||
not url.regexpMatch("\\{\\{\\s*url(_for)?\\(.+\\).*")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user