mirror of
https://github.com/github/codeql.git
synced 2025-12-16 16:53:25 +01:00
try to restrict the edges we follow (related to upper/lower-case) when contructing possible attack-strings for polynomial-redos
This commit is contained in:
@@ -365,11 +365,19 @@ module Make<RegexTreeViewSig TreeImpl> {
|
||||
)
|
||||
}
|
||||
|
||||
string getChar(CharNode t) {
|
||||
private string getCharInternal(CharNode t) {
|
||||
exists(InputSymbol s1, InputSymbol s2, InputSymbol s3 | t = Step(s1, s2, s3, _) |
|
||||
result = getAThreewayIntersect(s1, s2, s3)
|
||||
)
|
||||
}
|
||||
|
||||
string getChar(CharNode t) {
|
||||
result = getCharInternal(t) and
|
||||
not (
|
||||
// skip the upper-case char if we have the lower-case version.
|
||||
result.toLowerCase() != result and result.toLowerCase() = getCharInternal(t)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user