Skip to content

[P2][bug] cargo-audit-check.sh exits 0 when jq is missing #729

Closed

Description

@EVWorth

scripts/cargo-audit-check.sh parses cargo audit output with jq. In an
environment without jq it prints

scripts/cargo-audit-check.sh: line 67: jq: command not found
(parse failed)

and then exits 0.

Why it matters

The script is the security gate. CI has jq, so CI has always been right — but
the script exists so anyone can run the same check locally before pushing, and
locally it reports success while having read nothing.

That is how RUSTSEC-2026-0285 (the rustls TLS 1.3 advisory, #728) looked like a
problem introduced by a dependabot PR: I ran this script against main, got a
clean exit, and concluded main was fine. It wasn't — 1.1.0 had shipped with it.

A gate that cannot tell "nothing found" from "could not look" is worse than no
gate, because a green result gets believed.

Fix

Fail fast on a missing dependency, and fail on a parse error rather than
carrying on:

command -v jq >/dev/null || { echo "cargo-audit-check needs jq"; exit 2; }

and make the (parse failed) path a non-zero exit.

Worth checking the other scripts in scripts/ for the same shape while in
there — anything that pipes to jq and continues on failure has the same
problem.

Related

A second thing hid the same advisory: cargo audit reads a cached advisory
database, and a stale cache reports clean. Worth considering whether the script
should fetch before auditing, or at least report the database's age, so a local
run cannot silently answer from last month's data.

Activity

  1. added
    audit
    severity/p2
    kind/bug
    on Sep 23, 2026
  2. added a commit that references this issue on Oct 5, 2026
    0afd252
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cross-cuttingauditkind/bugseverity/p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions