Skip to content

v1.45.0 - Four security fixes for the scanner and the GitHub Action

Latest

Choose a tag to compare

@sonukapoor sonukapoor released this 03 Dec 13:43
v1.45.0
93883f6

Upgrade note. This release fixes four security issues, one of them high severity, in the scanner and the GitHub Action. Upgrade if you use the Action, --ratchet or --fail-on in CI. Six changes can affect an existing setup.

  • The GitHub Action now needs jq on the runner. GitHub-hosted runners have it; add it to self-hosted runners before upgrading.
  • The Action no longer prints a notice when a new major version of the CLI is available.
  • A ratchet baseline that cannot be read, or that is a symbolic link, now stops the scan with an error whenever the scan reads it, not only on --ratchet runs.
  • EXPERIMENTAL --python: a requirements file pinning a known malicious package now fails --fail-on at any level, so a scan that passed before can fail. Other Python findings still never affect the exit code.
  • A multi-folder --prod-only scan where every folder holds only dev dependencies now exits 0 instead of 3. It still exits 3 when a folder has skipped dependencies (unless --allow-empty is set), and --sarif, --cdx and --sbom are still refused in that case.
  • cve-lite config show, config set and config unset refuse extra arguments. config unset ca-cert --dry-run used to delete the saved certificate; it now stops with Unknown option: --dry-run.

Security

  • GitHub Action: the notice about a new major version of the CLI ran npm view inside the checked-out repository, so the project's .npmrc could choose the registry it asked, and the reply was compared using shell arithmetic, which can run commands. The notice is removed (GHSA-gfwg-3mmr-jr84, high). Reported and fixed by @vianmangal.
  • GitHub Action: with delta: true, a head scan that crashed, for example on merge-conflict markers in the lockfile or an unreachable advisory service, was read as an empty result, so the pull request comment reported every base finding as resolved. The Action now uses a scan's results only when the scan recorded a completed run, and fails the step otherwise (GHSA-9w3c-cvvr-2jx6). Reported and fixed by @vianmangal.
  • When OSV reported an advisory for one installed version of a package and npm's advisory data marked a second installed version as affected too, the second version was dropped from the results. Each installed copy now keeps its own matches (GHSA-grwv-3x7v-rj4x). Reported and fixed by @vianmangal.
  • A ratchet baseline that could not be read, or that was a symbolic link, could make a --ratchet scan overwrite or create a file outside the project. An invalid or linked baseline now stops the scan with an error, and a new baseline is only created where no file exists (GHSA-5vwq-w6v9-f67q). Reported and fixed by @vianmangal.

Added

  • EXPERIMENTAL --python: findings from requirements files generated by pip-compile, uv pip compile or uv export get real dependency paths and a direct or transitive label, read from the # via notes those tools write. A -r note pointing at another compiled file in the scan is followed, and a constraints file never makes a package direct when another file pins it. Files without notes behave as before, with a coverage note.
  • EXPERIMENTAL --python: findings show their upgrade target in the terminal, JSON and HTML. A finding in a file generated by pip-compile, uv pip compile or uv export gets a command that reruns the file's own header command with --upgrade-package name==version, writing the file in place from the right folder, base files first. When no command is safe, the finding says why: the project limit that blocks it, a hand-written pin, a missing input file, or the packages that pull it in. Headers with shell characters, upgrade-all flags or credentials never become commands. Mixed JavaScript and Python JSON carries the Python plan in a new pythonSuggestedFixCommands field.
  • EXPERIMENTAL --python: Python fix commands are checked against PyPI before they are printed. Every parent named in the file's # via notes must accept the target, the target must be published, not yanked, uploaded before the header's cutoff (--uploaded-prior-to, --exclude-newer, --exclude-newer-package), fit the file's Python version, and have requirements the project's inputs allow. Anything that fails or cannot be checked gets advice naming what to change instead of a command, files that resolve from a source other than PyPI say they were not checked, and a warning counts commands held back when PyPI cannot be reached. Transitive findings that pass get the same regeneration command as direct ones.
  • EXPERIMENTAL --python: --cdx and --sbom work on a Python-only folder. Packages get pkg:pypi/ identifiers with their advisories, SPDX relationships follow every parent named in the # via notes, and the document is named from pyproject.toml or the folder. A folder with JavaScript and Python together still refuses SBOM output.

Changed

  • EXPERIMENTAL --python: a requirements file pinning a package with a malicious-code (MAL-) advisory fails the --fail-on gate at any level, as npm packages do, in single-folder, mixed, multi-folder and ratchet scans. Other Python findings still do not affect the exit code, and the note that says so names malicious packages as the exception.

Fixed

  • EXPERIMENTAL --python: when an advisory's affected range ends at a pre-release (for example fixed: 1.10.0rc1), the first final release at or above it that clears every advisory is offered as the target, instead of no target.
  • EXPERIMENTAL --python: the HTML report no longer links the requirements file at the start of a Python dependency path to a PyPI page that does not exist. Package names in the path still link.
  • EXPERIMENTAL --python: flags such as --check-overrides that are skipped for Python stay recorded in JSON, the HTML report and the audit log, and the terminal no longer suggests passing a flag the user already passed.
  • SPDX output stays valid when a package declares a licence that is not a valid SPDX expression. Licence ids come from the official SPDX License List (3.27.0), LicenseRef- ids are kept and defined in the document, and anything else falls back to NOASSERTION.
  • --usage and --only-used read imports in Vue (<script>, <script setup>), Svelte and Astro components, so a dependency used only in a component is no longer treated as unused and dropped by --only-used. Components over 500KB are kept as usage unknown with a warning.
  • A multi-folder --prod-only scan names each folder the filter left with no packages, and when every folder is dev-only it says the filter caused it and exits 0 instead of 3. A folder that still has skipped dependencies keeps the empty-scan error, unless --allow-empty is set, and is named with its skipped entries, since a skipped dependency can hide a production package.
  • A vulnerable npm package bundled inside its parent no longer gets an npm update command that cannot move it. The finding says to update the package that ships it, in the terminal, JSON, SARIF and HTML.
  • Fix commands for packages declared in optionalDependencies keep the optional flag (-O, or --optional on Bun), in printed commands and in --fix, so running them no longer moves the package into dependencies.
  • When two findings need the same parent at different versions and the plan merges them into one upgrade, a finding only checked at the lower version is no longer counted as fixed. The upgrade is marked path-specific and the summary says how many it covers.
  • Yarn Berry workspaces excluded with a ! pattern (for example "!packages/legacy") are no longer offered yarn workspace <name> add commands, which Berry rejects.
  • Workspace patterns treat ? as a single-character wildcard, in both included and ! excluded patterns.
  • In a Bun workspace, a member folder whose name starts with - is written as ./-name after --cwd, in printed commands and in --fix, so Bun no longer reads it as an option.
  • A project .npmrc or .yarnrc.yml that sets only a scoped registry no longer hides the default registry from the user's own config. Scoped registries are merged across the config chain and fix versions are checked against the registry the project actually installs from.
  • The npm advisory lookup handles a package named constructor instead of marking the scan partial.
  • --check-overrides no longer stops the whole scan when a folder has a lockfile but no package.json. That folder's override audit is skipped with a note and every folder still gets its findings.
  • pnpm override keys that name a parent version, such as foo@1>bar or @scope/parent@^1.0.0>@scope/child, are read as targeting the child, and the override checks look at the matching copy of the parent.
  • cve-lite overrides is recognised after a flag that takes no value, as in cve-lite --json overrides or cve-lite . --debug overrides, while --cache-dir overrides still reads overrides as the flag's value.
  • cve-lite config subcommands refuse extra arguments with Unknown option or Unexpected argument before running, instead of ignoring them.
  • --check-licenses no longer crashes on an npm lockfile entry whose licence is an object ({ "type": "MIT" }) or an array. The object form is read like the string, and an array is reported as a missing licence (LC002).
  • --check-licenses reports dependencies declared by npm workspace members as direct, while nested copies used through other packages stay transitive.
  • SARIF output keeps an advisory without a CVE alias when another advisory on the same package has one. Rule ids are chosen per advisory.
  • Multi-folder terminal output prints each folder header once, with one empty line between folder sections.

Docs

  • The help for --sbom-inventory-only says it applies only to SPDX output, and that CycloneDX output still includes vulnerabilities.
  • The website homepage has a GitLab CI/CD button next to the GitHub Action one.

Validation

  • npm test
  • npm run build

Contributors