fix(python): --check-overrides is discarded and the CLI then tells you to use it

Aperta Adatta ai principianti
#1,863 5 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@akshad-exe ci sta già lavorando.

Dal 27/11/2026.

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
node.js, typescript

Direzione di ricerca

Leggi src/scan/single-scan.ts nella parte relativa alla sostituzione delle opzioni e all’indicazione di override, poi esamina src/scan/python-skipped-checks.ts e i generatori di JSON ed eventi di audit. Mantieni visibile nei report l’opzione richiesta dall’utente e assicurati che le scansioni Python saltino l’audit riservato a npm; conferma che l’indicazione non suggerisce più agli utenti di aggiungere un’opzione che hanno già fornito.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Title: fix(python): --check-overrides is silently discarded and the CLI then tells you to use it

Describe the bug

A --python scan cannot run the npm-only override audit; that is intentional and the coverage
notes say "Override checks not run for Python packages." But handleSingleFolderScan() replaces
the parsed options with withoutNpmOnlyChecks(options) (src/scan/single-scan.ts:266), which sets
checkOverrides to false. Everything downstream then treats the run as if the user never asked
for the check:

  • the terminal prints the contradictory tip "override entries detected - run with --check-overrides to audit them";
  • effectiveOptions.checkOverrides in --json is false;
  • the scan.started audit event records checkOverrides: false.

So the user is told both that the check was not run and that they should have requested it, while
their actual request is erased from machine-readable output.

Reproduce

Any directory with a package.json containing overrides and a pinned requirements.txt:

// package.json
{"name":"x","overrides":{"ghost":"1.0.0"}}
# requirements.txt
urllib3==1.26.4
cve-lite . --python --check-overrides --verbose

Output contains both:

Coverage notes
• Override checks not run for Python packages.
...
💡 Tip: override entries detected - run with --check-overrides to audit them for stale or broken overrides.

With --json --audit-log <path>:

effectiveOptions.checkOverrides = false
scan.started.flags.checkOverrides = false

Expected behavior

The coverage note may remain, but the CLI must not suggest an already-supplied flag, and the
machine-readable payloads must preserve the flag the user actually passed. The clean fix is to keep
the original options for reporting and use the stripped copy only for the npm-only checks (or pass
an explicit overrideChecksSkipped note while leaving checkOverrides true).

Where

  • src/scan/single-scan.ts:266 — options = withoutNpmOnlyChecks(options) overwrites the parsed options.
  • src/scan/single-scan.ts:899,936,959 — showOverrideHint is derived from the overwritten options.checkOverrides.
  • src/scan/python-skipped-checks.ts:21-31 — withoutNpmOnlyChecks() clears usage, onlyUsed, checkOverrides, checkMaintenance, checkLicenses.
  • buildScanJson / scan.started build their flag views from the overwritten options.

Checks done

  • Reproduced with a real CLI run (Node v24.22.1, local HTTPS OSV mock for the Python scan).
  • upstream/main has the same overwrite and hint logic.
  • No open or closed issue/PR reports this contradiction (searched for python + check-overrides, override hint, override checks not run).
  • No test pins the contradictory hint for Python scans.

Environment

  • CVE Lite CLI 1.43.0 built from upstream/main
  • Node v24.22.1, Linux
Lingua principale
TypeScript
Stelle
806
Fork
209
Merge medio
3g 16h
PR unite (30g)
133

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OWASP/cve-lite-cli

Tutte le issue di OWASP/cve-lite-cli

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.