-
Notifications
You must be signed in to change notification settings - Fork 2k
ReDoS: Spelling nfautils #10799
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
Merged
Merged
ReDoS: Spelling nfautils #10799
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
370da94
spelling: abcdefghijklmnopqrstuvwxyz
jsoref 98b317d
spelling: escape
jsoref c7ae072
spelling: javascript
jsoref adb8860
spelling: pattern
jsoref bb1ce89
spelling: repeatable
jsoref 09c8a98
spelling: representation
jsoref File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -59,8 +59,8 @@ predicate matchesEpsilon(RegExpTerm t) { | |
| /** | ||
| * A lookahead/lookbehind that matches the empty string. | ||
| */ | ||
| class EmptyPositiveSubPatttern extends RegExpSubPattern { | ||
| EmptyPositiveSubPatttern() { | ||
| class EmptyPositiveSubPattern extends RegExpSubPattern { | ||
| EmptyPositiveSubPattern() { | ||
|
Comment on lines
-62
to
+63
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -Patttern
+Pattern |
||
| ( | ||
| this instanceof RegExpPositiveLookahead | ||
| or | ||
|
|
@@ -70,6 +70,9 @@ class EmptyPositiveSubPatttern extends RegExpSubPattern { | |
| } | ||
| } | ||
|
|
||
| /** DEPRECATED: Use `EmptyPositiveSubPattern` instead. */ | ||
| deprecated class EmptyPositiveSubPatttern = EmptyPositiveSubPattern; | ||
|
|
||
| /** | ||
| * A branch in a disjunction that is the root node in a literal, or a literal | ||
| * whose root node is not a disjunction. | ||
|
|
@@ -133,7 +136,7 @@ private predicate isCanonicalTerm(RelevantRegExpTerm term, string str) { | |
| } | ||
|
|
||
| /** | ||
| * Gets a string reperesentation of the flags used with the regular expression. | ||
| * Gets a string representation of the flags used with the regular expression. | ||
| * Only the flags that are relevant for the canonicalization are included. | ||
| */ | ||
| string getCanonicalizationFlags(RegExpTerm root) { | ||
|
|
@@ -334,7 +337,7 @@ private module CharacterClasses { | |
| ) | ||
| } | ||
|
|
||
| private string lowercaseLetter() { result = "abdcefghijklmnopqrstuvwxyz".charAt(_) } | ||
| private string lowercaseLetter() { result = "abcdefghijklmnopqrstuvwxyz".charAt(_) } | ||
|
Comment on lines
337
to
+340
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. -abdc
+abcd |
||
|
|
||
| private string upperCaseLetter() { result = "ABCDEFGHIJKLMNOPQRSTUVWXYZ".charAt(_) } | ||
|
|
||
|
|
@@ -697,9 +700,7 @@ predicate delta(State q1, EdgeLabel lbl, State q2) { | |
| lbl = Epsilon() and q2 = Accept(getRoot(dollar)) | ||
| ) | ||
| or | ||
| exists(EmptyPositiveSubPatttern empty | q1 = before(empty) | | ||
| lbl = Epsilon() and q2 = after(empty) | ||
| ) | ||
| exists(EmptyPositiveSubPattern empty | q1 = before(empty) | lbl = Epsilon() and q2 = after(empty)) | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -1028,7 +1029,7 @@ module ReDoSPruning<isCandidateSig/2 isCandidate> { | |
| * as the suffix "X" will cause both the regular expressions to be rejected. | ||
| * | ||
| * The string `w` is repeated any number of times because it needs to be | ||
| * infinitely repeatedable for the attack to work. | ||
| * infinitely repeatable for the attack to work. | ||
| * For the regular expression `/((ab)+)*abab/` the accepting state is not reachable from the fork | ||
| * using epsilon transitions. But any attempt at repeating `w` will end in a state that accepts all suffixes. | ||
| */ | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add this above? (In all copies of
NfaUtils.qll).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it seems the code formatter check is failing.
Either autoformat using VSCode, or do
codeql query format -i.