Repository navigation
fix(scan): surface unparseable scanner output as error, not "ran clean" - #74
Merged
Merged
Conversation
`runScanners` piped every scanner's stdout through the lenient `ingest()`,
which returns `[]` on any malformed input. So a scanner that printed a stack
trace, an error blob, or the wrong format was recorded as `ran` with 0
findings — a broken scanner hid behind a green consolidated verdict, the
classic fail-open that a security gate must not have. (Internally inconsistent
too: `osvSeverity` already defaults unknown labels to `high`, i.e. cautious,
while parse failure was silently empty, i.e. uncautious.)
Add `ingestStrict()` to the ingest adapter: it distinguishes a *valid but
empty* report (scanner ran, found nothing) from *malformed / wrong-shape*
output, returning a discriminated `{ ok }` outcome. `runScanners` now marks an
unparseable non-empty output — and an empty output from a failed process — as
`error`, while a valid empty SARIF/OSV stays `ran/0`. The lenient `ingest()`
is unchanged for the `kit ingest` command and existing callers.
Follow-up (noted, not in scope): the `kit scan` command layer should let an
`error` scanner run downgrade the overall verdict rather than report all-clear.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ERHw6bVUz39sAuoQZ1iyg
|
✅ Docker image built successfully
|
This was referenced Jun 24, 2026
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.
runScannerspiped scanner stdout through the lenientingest(), which returns[]on any malformed input — so a scanner that printed a stack trace or the wrong format was recorded asranwith 0 findings, hiding behind a green consolidated verdict (classic fail-open).Fix: new
ingestStrict()distinguishes a valid-but-empty report from malformed/wrong-shape output (discriminated{ ok }).runScannersmarks unparseable output (and empty output from a failed process) aserror; a valid empty SARIF/OSV staysran/0. Lenientingest()unchanged forkit ingest. Tests added. (Security review finding.)