OWASP / OWASP/cve-lite-cli

[Bug] compact and verbose report different headline counts for the same scan

Open
#1,168 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug in-house
Dominant language
TypeScript
Stars
715
Forks
145
Avg merge
21h 39m
Merged PRs (30d)
66

Description

Note: this is an in-house item already being handled by the maintainer - not open for contribution. Filed for tracking only.

The final status line is built twice in src/output/printers.ts, about 350 lines apart, and the two copies have drifted. The same scan reports a different headline number depending on which mode you run.

$ cve-lite examples/open-source-friday-demo/shipping-api
✖ Scan complete. 7 urgent issues found.

$ cve-lite examples/open-source-friday-demo/shipping-api --verbose
✖ Scan complete. 11 vulnerabilities found (1 critical, 6 high). Start with the priority fixes above.

Three separate problems:

1. 7 against 11. Compact counts counts.critical + counts.high (printers.ts:1014); verbose counts findings.length (printers.ts:666). Both are defensible numbers, but nothing tells the reader they are different units, so adding --verbose looks like the tool changing its mind.

2. "vulnerabilities" is the wrong noun, and the number is wrong with it. findings.length counts vulnerable packages. That scan found 11 vulnerable packages carrying 94 vulnerabilities, so "11 vulnerabilities found" is inaccurate regardless of the mode comparison. This one is wrong on its own.

3. The suffixes differ. Verbose appends "Start with the priority fixes above", compact appends nothing.

Fix

Extract one builder both call sites use, so the modes agree by construction rather than by coincidence:

compact:  ✖ Scan complete. 11 vulnerable packages, 7 urgent (1 critical, 6 high).
verbose:  ✖ Scan complete. 11 vulnerable packages, 7 urgent (1 critical, 6 high). Start with the priority fixes above.

The ⚠ Partial scan: variants at :668 and :1015 take the same builder so they stay consistent too.

Also delete the 94 CVEs matched overall bullet from Quick take (printers.ts:87). It sits four lines below ✗ Found 11 packages (94 CVEs) and is the third time that number appears in verbose output.

Not in scope

Where the summary block sits, whether the severity box moves, and whether compact gains a Found line. Those are layout preferences and #1145 already reworked this output in v1.35.0; a second restructure in consecutive releases is not worth it. This issue is only the wording and the counts.

Related: #1151, compact truncating findings and command groups without disclosing it. Same family, the two modes disagreeing about what they are telling you.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/output/printers.ts at the compact and verbose status-line call sites around lines 666, 1014, and 1015, plus the Quick take entry around line 87. Verify both modes and their partial-scan variants report the same package and severity counts, use consistent wording and suffixes, and avoid the repeated CVE bullet.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
10/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.