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:
erik-krogh
2024-02-22 13:15:17 +01:00
parent 95ce0cd640
commit e74e5b3613

View File

@@ -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)
)
}
}
/**