Skip to content

Keep a security-audit BLOCKER that an unindented code fence follows - #1371

Open
dormouse-bot wants to merge 1 commit into
mainfrom
fix/audit-fence-drops-finding
Open

dormouse-bot wants to merge 1 commit into
mainfrom
fix/audit-fence-drops-finding

Conversation

@dormouse-bot

Copy link
Copy Markdown
Collaborator

parseFragment in scripts/security-audit-report.mjs dropped an open BLOCKER or WARNING when the next unindented line was a code fence. The fence branch set finding = null without calling closeFinding, so the finding never reached parsed.findings, and domainVerdict judged the fragment as if it hadn't been written (line 195). This PR closes the open finding before toggling the fence.

The effect on the nightly audit: a domain that writes VERDICT: FAIL, a fully evidenced BLOCKER, and then a column-0 fenced snippet gets INCONCLUSIVE, because its stated FAIL has no finding behind it. A domain that left VERDICT: PASS on line 1 gets PASS, so the release gate opens on a run that reported a BLOCKER. Before the fix, parseFragment on such a fragment returned zero findings. After it, it returns one.

The test is a new reporting: case in scripts/security-audit.test.mjs: the existing BLOCKER fixture followed by an unindented fence. It expects FAIL. Without the fix it gets INCONCLUSIVE (MISSING from compose). With it, all 179 tests in the file pass, and so do security-audit-canary.test.mjs and github-state-check.test.mjs.

parseFragment reset the open finding on a column-0 fence without closing
it, so the BLOCKER never reached parsed.findings and the domain's verdict
was computed as if it had not been written.
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: e58fb64
Status: ✅  Deploy successful!
Preview URL: https://a18bcdfa.mouseterm.pages.dev
Branch Preview URL: https://fix-audit-fence-drops-findin.mouseterm.pages.dev

View logs

This branch has not been deployed

No deployments
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.

1 participant