mirror of
https://github.com/github/codeql.git
synced 2025-12-23 12:16:33 +01:00
Detect Django template URLs
Django URLs are currently not detected, but flask and nunjucks URL are. (See https://github.com/github/codeql/issues/12267)
This commit is contained in:
@@ -44,7 +44,9 @@ predicate hasDynamicHrefHostAttributeValue(DOM::ElementDefinition elem) {
|
||||
// ... 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 / nunjucks application
|
||||
not url.regexpMatch("\\{\\{\\s*url(_for)?\\(.+\\).*")
|
||||
not url.regexpMatch("\\{\\{\\s*url(_for)?\\(.+\\).*") and
|
||||
// .. that is not a call to `url` in a Django application
|
||||
not url.regexpMatch("\\{%\\s*url.*")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user