-
Notifications
You must be signed in to change notification settings - Fork 1.7k
JS: RegExp unknown flags support and enhanced compatibility with RegExp objects #18089
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
Changes from all commits
Commits
Show all changes
36 commits
Select commit
Hold shift + click to select a range
178da21
JS: Added test case for CWE-178 RegExp with unknown flags
Napalys e38b63e
JS: previously js/case-sensitive-middleware-path was not taking into …
Napalys d6372ae
Update javascript/ql/src/Security/CWE-178/CaseSensitiveMiddlewarePath.ql
Napalys 41f21d4
JS: Added test case which is not flagged but should be abusing new Re…
Napalys 38be0e4
JS: Now BadHtmlSanitizers also flags new RegExp as potential issue
Napalys 89f3b6f
JS: Added test case for bad sanitizer with unknown flags, currently n…
Napalys 18c7b18
JS: Now BadHtmlSanitizers new RegExp with unknown flags is also flagged.
Napalys 41fef0f
JS: Added test cases which cover new RegExp creation with replace on …
Napalys faef9dd
JS: protyte poluting now treats unknownFlags as potentially good sani…
Napalys 7db6f7c
JS: Added test cases with new RegExp for Tainted paths, currently wor…
Napalys eca7a88
JS: Fixed docs description
Napalys 23b18ae
JS: Now unknown flags are not flagged in taint paths
Napalys 155f1fc
JS: Added test cases for unsafe shell command sanitization with RegEx…
Napalys a0df33c
JS: UnsafeShellCommand Using unknown flags in the RegExp object is no…
Napalys aa557cf
JS: Added tests for DotRemovingReplaceCall with RegExp Object.
Napalys 875478c
JS: Fixed path query not flagging new RegExp with DotRemovingReplaceCall
Napalys 9c2366a
JS: Added tests for ReDos with unknownFlags, everything seems to be good
Napalys 7631803
JS: Add test cases for RegExp object usage in replace within incomple…
Napalys 1ae1748
JS: incomplete sanitization now also works with RegExp objects
Napalys 98fd977
JS: imcomplete sanization now handles properly maybe global
Napalys fe28657
JS: add test cases with unknown flags for double escaping, works as e…
Napalys dbae553
JS: add xss test cases with unknownflags for replace using RegExp
Napalys c71778f
JS: xss does not flag anymore replace with RegExp unknown flags
Napalys 1ca57cf
JS: add test cases with RegExp object for MaskingReplacer, currently …
Napalys a2c4674
JS: fixed issue where MaskingReplacer would work only with regexp lit…
Napalys e673348
JS: now RegExp with unknown flags is not flagged as an issue within p…
Napalys 62194f5
JS: add test cases RegExp with unknown flags
Napalys 1d2e08a
JS: now Reg Exp injection treats unknownFlags as sanitization, Metach…
Napalys 9a1c1f4
JS: Added in RegExpCreationNode maybeGlobal predicate for more conven…
Napalys fd77360
Added change notes
Napalys 9ca0fe4
Update RegExp handling and add test case
Napalys d2de9a2
Fixed change notes
Napalys 13afd63
Update javascript/ql/lib/change-notes/2024-11-28-regexp-unknown-flags.md
Napalys 3171f38
JS: fixed bad alert messages when it came to incomplete sanitization …
Napalys 9d4e737
JS: follow proper code standards for get predicates
Napalys 08ef0dc
Update javascript/ql/lib/change-notes/2024-11-28-regexp-unknown-flags.md
Napalys 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
6 changes: 6 additions & 0 deletions
6
javascript/ql/lib/change-notes/2024-11-28-regexp-unknown-flags.md
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
category: majorAnalysis | ||
--- | ||
* The `js/incomplete-sanitization` query now also checks regular expressions constructed using `new RegExp(..)`. Previously it only checked regular expression literals. | ||
* Regular expression-based sanitisers implemented with `new RegExp(..)` are now detected in more cases. | ||
* Regular expression related queries now account for unknown flags. |
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
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.