Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion scripts/security-audit-report.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ export function parseFragment(text, { evidence = true } = {}) {
if (FENCE_RE.test(line)) fenced = !fenced;
continue;
}
if (FENCE_RE.test(line)) { fenced = !fenced; finding = null; continue; }
// An unindented fence ends the open finding: its evidence was the lines above.
if (FENCE_RE.test(line)) { if (finding) closeFinding(parsed, finding, evidence); fenced = !fenced; finding = null; continue; }
if (fenced) continue;
if (finding) closeFinding(parsed, finding, evidence);
finding = null;
Expand Down
5 changes: 5 additions & 0 deletions scripts/security-audit.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,11 @@ const cases = [
{ name: 'a BLOCKER fails the run', status: 'PASS',
frags: only({ [REMOTE]: { stated: 'FAIL', lines: finding('BLOCKER', 'deploy/local/install-windows.ps1:88', 'Install-Service', 'a file name reaches Invoke-Expression') } }),
expected: 'FAIL', publicRows: [`| \`${REMOTE}\` | FAIL | 0 | 0 | 0 | 1 | 0 |`] },
// An unindented code fence after a BLOCKER's evidence once dropped the
// BLOCKER, so the run passed on the domain's lines alone.
{ name: 'a BLOCKER followed by an unindented fence still fails the run', status: 'PASS',
frags: only({ [REMOTE]: { stated: 'FAIL', lines: [...finding('BLOCKER', 'deploy/local/install-windows.ps1:88', 'Install-Service', 'a file name reaches Invoke-Expression'), '```', 'Invoke-Expression "& $name"', '```'] } }),
expected: 'FAIL', publicRows: [`| \`${REMOTE}\` | FAIL | 0 | 0 | 0 | 1 | 0 |`] },
{ name: 'a BLOCKER without its evidence still fails, and is malformed', status: 'PASS',
frags: only({ [LOCAL]: { stated: 'FAIL', lines: ['- BLOCKER: `lib/x.ts:4` `run` — something'] } }),
expected: 'FAIL', notes: ['BLOCKER without its Code, Path, Reproduction evidence'] },
Expand Down
Loading