-
Notifications
You must be signed in to change notification settings - Fork 1.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
JavaScript: false positive with unicode sets for character classes that contain brackets #18854
Comments
Thanks for reporting. I suspect the regex parser gets confused by the |
Yes, we know, and we're planning to fix it. Our parser doesn't currently understand the |
Thanks again for the report. I've fixed the issue as part of this PR: #18899 |
Description of the false positive
Earlier, a colleague of mine filed #18721 regarding adding support for the
v
flag. That was implemented but it seems like there's some false positives without properly handling of the set operations.More specifically, the regex below fails with the ID
js/regex/duplicate-in-character-class
since it believes[\S--[\[\]]]
is a character class that contains brackets ([]
) twice.Code samples or links to source code
at https://github.com/mozilla/pdf.js/blob/fef706233d6870ddb01ac2131a2ee157262187a4/web/autolinker.js#L101-L101.
URL to the alert on GitHub code scanning (optional)
https://github.com/mozilla/pdf.js/security/code-scanning/1003
The text was updated successfully, but these errors were encountered: