close
Skip to content

fix: improve SRI_REGEX#151

Merged
wraithgar merged 1 commit intonpm:mainfrom
ericcornelissen:patch-1
Oct 20, 2025
Merged

fix: improve SRI_REGEX#151
wraithgar merged 1 commit intonpm:mainfrom
ericcornelissen:patch-1

Conversation

@ericcornelissen
Copy link
Copy Markdown
Contributor

Update SRI_REGEX to avoid potential polynomial evaluation time due to possible exchange of characters between [^?]+ and [?\S*]*. Requiring a ? explicitly avoids this problem and making the last group optional is required to match the previous zero-or-more matching behavior.

Update SRI_REGEX to avoid potential polynomial evaluation time due
to possible exchange of characters between '[^?]+' and '[?\S*]*'.
@ericcornelissen ericcornelissen requested a review from a team as a code owner October 17, 2025 06:11
@wraithgar wraithgar self-assigned this Oct 17, 2025
@wraithgar wraithgar changed the title Improve SRI_REGEX fix: improve SRI_REGEX Oct 17, 2025
@wraithgar
Copy link
Copy Markdown
Contributor

Since codeql hiccuped I put the new regex through a redos checker:

results from https://devina.io/redos-checker showing no redos in the submitted change

@wraithgar
Copy link
Copy Markdown
Contributor

This more closely matches the regex at the end of STRICT_SRI_REGEX now: (\?[\x21-\x7E]*)?$

@wraithgar wraithgar merged commit 8f0bbf2 into npm:main Oct 20, 2025
19 of 21 checks passed
@github-actions github-actions Bot mentioned this pull request Oct 20, 2025
@ericcornelissen ericcornelissen deleted the patch-1 branch October 20, 2025 19:39
owlstronaut pushed a commit that referenced this pull request Oct 22, 2025
🤖 I have created a release *beep* *boop*
---


## [13.0.0](v12.0.0...v13.0.0)
(2025-10-22)
### ⚠️ BREAKING CHANGES
* `ssri` now supports node `^20.17.0 || >=22.9.0`
### Bug Fixes
*
[`46a2520`](46a2520)
[#155](#155) align to npm 11 node engine
range (#155) (@owlstronaut)
*
[`8f0bbf2`](8f0bbf2)
[#151](#151) improve `SRI_REGEX` (#151)
(@ericcornelissen)
### Chores
*
[`79e0018`](79e0018)
[#146](#146) postinstall workflow
updates (#146) (@owlstronaut)
*
[`89b775a`](89b775a)
[#154](#154) bump @npmcli/template-oss
from 4.26.0 to 4.27.1 (#154) (@dependabot[bot], @npm-cli-bot)

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants