Skip to content
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

ReDoS: fix canonicalization in NfaUtils #11071

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

erik-krogh
Copy link
Contributor

@erik-krogh erik-krogh commented Nov 1, 2022

The cc = getCanonicalCharClass(term) predicate got a char-class for the canonical representative term, so it was not meant to be used unless you already had the canonical representative.

That wasn't how it was used in js/incomplete-multi-character-sanitization, which caused a FN when I converted the regex code to a shared pack.
(Some sorting got slightly changed, which changed the canonicalization a tiny bit).

Evaluation looks good: Python, Ruby, Java, JavaScript.
Performance is neutral, and there are a few more results that were erroneously missing due to the bad canonicalization.

@erik-krogh erik-krogh requested review from a team as code owners Nov 1, 2022
@erik-krogh erik-krogh added the no-change-note-required This PR does not need a change note label Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant