-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential catastrophic backtracking #10002
Potential catastrophic backtracking #10002
Comments
Since this would have to be caused by a malicious rule, and the "victim" of the attack would have to enable the rule (or the shared config providing it) themselves, this doesn't seem worrying at all. |
Agreed, not a problem as currently used in eslint. But since people like to copy/paste regexes, thought I would let you know about it. |
Can the regex be improved to prevent catastrophic backtracking without changing the function at all? If so, I would love to see a pull request. If not, though, I agree that this isn't worth worrying about. |
Change template substitution regex to exclude fields with whitespace. This addresses possible O(n^2) catastrophic backtracking behavior. Very unlikely to be exploited. For eslint#10002.
Sure. See #10019. |
Change template substitution regex to exclude fields with whitespace. This addresses possible O(n^2) catastrophic backtracking behavior. Very unlikely to be exploited. For eslint#10002.
Change template substitution regex to exclude fields with whitespace. This addresses possible O(n^2) catastrophic backtracking behavior. Very unlikely to be exploited. For eslint#10002.
One of the regexes in eslint is vulnerable to catastrophic backtracking.
@nzakas says this isn't a problem as used in eslint:
Perhaps a comment to warn future copy/pasters might be in order, however.
Here's a description of the problematic pattern and an attack string.
{
"pattern" : "\{\{\s*([^{}]+?)\s*\}\}",
"nPumpsFor10Sec" : "48325",
"filesIn" : [
[
"lib/util/interpolate.js"
]
],
"blowupCurve" : {
"r2" : 0.996141596724248,
"parms" : [
3.10391182858704e-08,
1.82075786106333
],
"type" : "POWER"
},
"attackFormat" : {
"suffix" : "{\t{",
"pumpPairs" : [
{
"pump" : "a",
"prefix" : "{{\t"
},
{
"pump" : "\t",
"prefix" : "a"
}
]
},
"stringLenFor10Sec" : 96657
}
The text was updated successfully, but these errors were encountered: