Repository navigation
fix(inspection): read the signatory line in linear time - #67
Merged
Merged
Conversation
The /^Signed:\s*(.+)$/ pattern let \s* and .+ both match leading whitespace, so a signature line of many spaces that failed to match backtracked quadratically (CodeQL js/polynomial-redos). Require the captured value to start with a non-space character; a whitespace-only signature now reads as no signatory. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
devin-ai-integration
Bot
dismissed
their stale review
November 23, 2026 16:35
Devin withdrew its approval: Autoapprover no longer classifies this pull request as safe to merge without human review.
- Intent: The performance test allows slower reads than the PR description promises.
Warning: CI checks and external Devin Review findings are not visible, so their approval requirements were not applied.
Contributor
There was a problem hiding this comment.
Devin Review found 2 findings. Devin automatically fixed all 2 findings.
Fixed by Devin (2)
- Load-sensitive signature regression test — Bound widened to 2000 ms; the old regex takes ~21 s on this input, so the test still discriminates with 10x margin.
- Mismatch in documented test budget — PR description updated to the 2,000 ms bound; no code change needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes
Fixes CodeQL js/polynomial-redos alert 3 in
src/inspection/fields.mjs./^Signed:\s*(.+)$/let\s*and.+both match leading whitespace, so aSigned:line of many spaces that fails to match (e.g. ends in\n\n) backtracks quadratically. The pattern is now/^Signed:\s*(\S.*)$/: the value must start with a non-space character, which leaves one way to split the line.Behavior: unchanged for every real signature (same captured value, trailing spaces included). A whitespace-only
Signed:line used to yield a signatory of" "; it now yieldsnull, so theconformance-signaturerule treats it as missing (fail-closed). PDF inputs already trim such lines toSigned:, so this only affects raw line inputs.New
tests/fields.test.mjs: signatory read with cite, whitespace-only signature isnull, and a 200,000-space pathological line read in under 2,000 ms (the old regex takes ~21 s on it; the bound leaves headroom for loaded runners).Evidence
docker compose run --build --rm verify(ALL GREEN, 16 steps),gate(RELEASE ALLOWED,docs/TESTING.mdunchanged) anddrill(2/2 regressions blocked) passRegression test against the old regex vs the fix:
Boundary impact
none
Implemented in session Fix heatlot polynomial ReDoS CodeQL alert
Review with Devin · Open in Devin Desktop