fix: harden release issue parsing (#1536)

Hardens release issue parsing against a quadratic/ReDoS pattern while preserving parsing semantics.
This commit is contained in:
Kai (Tam Nhu) Tran authored and GitHub committed 2026-06-15 23:24:33 -04:00
1 parent 10aff10a67
commit 74dd2f38cc
4 files changed
+59 -14

No files matched your search

@@ -30,6 +30,11 @@ describe('stable release issue cleanup', () => {
expect(extractIssueNumbers(text, { includeRefs: false })).toEqual([12, 13, 14, 15]);
});
it('handles long unmatched whitespace after an issue reference in linear time', () => {
const text = `Fixes #1${' '.repeat(50_000)}X`;
expect(extractIssueNumbers(text, { includeRefs: true })).toEqual([1]);
});
it('extracts PR numbers from merge and squash commit subjects', () => {
const text = [
'Merge pull request #1392 from kaitranntt/kai/fix/foo',