mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
allow mailto links in js/unsafe-external-link
This commit is contained in:
@@ -31,7 +31,9 @@ predicate hasDynamicHrefHostAttributeValue(DOM::ElementDefinition elem) {
|
||||
// fixed string with templating
|
||||
url.regexpMatch(Templating::getDelimiterMatchingRegexp()) and
|
||||
// ... that does not start with a fixed host or a relative path (common formats)
|
||||
not url.regexpMatch("(?i)((https?:)?//)?[-a-z0-9.]*/.*")
|
||||
not url.regexpMatch("(?i)((https?:)?//)?[-a-z0-9.]*/.*") and
|
||||
// ... that is not a mailto: link
|
||||
not url.regexpMatch("mailto:.*")
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -26,5 +26,8 @@
|
||||
Example
|
||||
</a>
|
||||
|
||||
<h1>OK: mailto is fine.</h1>
|
||||
<a target="_blank" href="mailto:{{var:mail}}">mail somone</a>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user