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

fix possible ReDoS #1536

Merged
merged 6 commits into from
Mar 8, 2024
Merged

fix possible ReDoS #1536

merged 6 commits into from
Mar 8, 2024

Conversation

illetid
Copy link
Contributor

@illetid illetid commented Mar 7, 2024

Type of PR: bugfix

PR checklist:

  • Addresses an existing issue: fixes [CLL-263]

Overview of change:
color regex const rgbaRe = /^rgba\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?[\d]{0,10}(?:\.\d+)?)\s*\)$/; contains possible weakness, for cases like 'rgba(0,0,0,' + '\t'.repeat(54773) + '\x00' . Changed regex to /^rgba\(\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d{1,10})\s*,\s*(-?\d*\.?\d+)\s*\)$/

src/helpers/color.ts Outdated Show resolved Hide resolved
src/helpers/color.ts Outdated Show resolved Hide resolved
src/helpers/color.ts Outdated Show resolved Hide resolved
@illetid illetid merged commit f1fceb5 into master Mar 8, 2024
22 checks passed
@illetid illetid deleted the fix-color-redos branch March 8, 2024 16:07
@SlicedSilver SlicedSilver added the bug Unexpected problem or unintended behavior. label Mar 11, 2024
@SlicedSilver SlicedSilver added this to the 5.0 milestone Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected problem or unintended behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants