v1.0.0 · GitHub Action and CLI

Catch bad crates before you merge them.

RustSecJP check reads your Cargo.lock and comments on the pull request when a dependency is malicious, has a known vulnerability, or has a name made to look like a popular crate. Nothing from your project is built or run.

.github/workflows/rustsecjp-check.yml
on:
  pull_request:
    paths: ["**/Cargo.lock", "**/Cargo.toml"]
permissions:
  contents: read
  pull-requests: write
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: RustSecJP/check@v1

CLI for Linux, macOS and Windows · Other platforms · MIT or Apache-2.0

Malicious · Vulnerable · Look-alikeOne check for removed malware crates, RUSTSEC / GHSA / CVE advisories and typosquat-like names
Nothing built or runNo checkout, no build.rs, no cargo. Cargo.lock is read as data.
One comment per PRUpdated on every push, mirrored to the job summary, and a pass/fail status you can require
When you'll use it

The moments a bad crate slips in

Supply-chain attacks on crates.io rarely arrive as a crate you chose. They come in through a bump, a transitive dependency, or a project you did not write.

Dependency bumps

A Dependabot PR pulls in a look-alike crate

A routine version bump adds a new transitive dependency called serde-rs or reqwets. Before anyone clicks merge, the comment names it, shows the popular crate it imitates, and flags it as a look-alike to review.

Audits

You inherit a Rust project

Someone hands you a repository with five workspaces and years of lockfile history. Run the CLI once: every Cargo.lock is checked, and you get each vulnerable, unmaintained or malicious crate with the version that fixes it.

rustsecjp-check --fail-on vulnerability
CI policy

Blocking merges in CI

Make the job a required status check. With fail-on: malicious (or vulnerability for stricter projects), a pull request that adds a known-bad crate simply cannot be merged.

- uses: RustSecJP/check@v1
  with:
    fail-on: vulnerability
New advisories

An advisory lands while a PR is still open

A crate in an open pull request is reported malicious the next day. A maintainer comments @rustsecjp-bot check and the existing comment is refreshed with the latest data, with no new commit needed.

Features

What it checks

Every crates.io dependency in every Cargo.lock, against public advisory data and RustSecJP's own incident records.

Malicious crates

Crates removed from crates.io for containing malware (MAL-* and RustSec "malicious" advisories, via OSV).

Known vulnerabilities

RUSTSEC, GHSA and CVE advisories with the version that fixes each one, plus unmaintained and unsound notices.

Look-alike names

Names one edit away from a top-1,000 crate, -/_ swaps, and -rs or -rust suffixes. A hint to review, never a verdict.

RustSecJP incident records

Crates in campaigns tracked by RustSecJP/incidents. For hijacked legitimate crates, only the recorded bad versions are flagged.

One comment, kept current

A single pull-request comment that is rewritten on each push, the same report in the job summary, and a status you can make required.

CLI and JSON too

The same checks run locally on any project, with --format json for scripts and exit codes for CI.

How it works

From lockfile to comment, without touching your code

  1. Get the binary

    Downloads the release for the runner and verifies it against SHA256SUMS.

  2. Read Cargo.lock

    Fetches the lockfile from the PR's head commit through the GitHub API. No checkout.

  3. Ask OSV

    Sends crate names and versions (only those) to OSV for advisories.

  4. Cross-check

    Matches RustSecJP incident records and compares names with popular crates.

  5. Report

    Writes or updates one comment, fills the job summary, and passes or fails the job.

Safety

Safe to run on pull requests from strangers

Checking dependencies should not mean running them. RustSecJP check never builds or runs anything from the repository it checks.

  • Nothing is built or run. No actions/checkout, no cargo, so a fork's build.rs, proc-macros or scripts never execute, even in workflows with a write token.
  • The binary is verified. The release asset must match SHA256SUMS, or the step stops. Pin a commit SHA and only that exact build is used.
  • Only names and versions leave. Source code, paths, git/path dependencies and private registry names are never sent anywhere.
  • Re-checks are gated. The @rustsecjp-bot check command only runs for repository owners, members and collaborators.

Good to know

  • Reports are written in Japanese. Crate names, versions, advisory IDs and links read the same in any language, and --format json is available for tools.
  • Only problems already in OSV or RustSecJP records are found; a freshly removed crate can take hours or days to get an advisory.
  • Look-alike names are a hint: legitimate crates can appear, and some imitations can be missed.
  • The code inside crates is not read, and projects without a Cargo.lock cannot be checked.
Install

Add it in two minutes

Use it as a GitHub Action, or download the CLI for your machine.

GitHub Action

Save this as .github/workflows/rustsecjp-check.yml. No Rust toolchain needed. @v1 follows the newest 1.x release; pin @v1.0.0 to stay put.

name: RustSecJP check
on:
  pull_request:
    paths: ["**/Cargo.lock", "**/Cargo.toml"]
permissions:
  contents: read        # read Cargo.lock through the API
  pull-requests: write  # post the result as a comment
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - uses: RustSecJP/check@v1
        with:
          fail-on: malicious   # malicious | vulnerability | never

Want @rustsecjp-bot check re-runs too? Use examples/workflow.yml.

Run it locally

In any Rust project. Exit code 1 when --fail-on matches.

cd your-rust-project
rustsecjp-check
rustsecjp-check --format json --output report.json

Download the CLI

These links always point to the newest release. Linux builds need glibc 2.35+ (Ubuntu 22.04 and newer).

PlatformFileNotes
Linux x86_64rustsecjp-check-linux-x86_64.tar.gz
Linux arm64rustsecjp-check-linux-aarch64.tar.gz
macOS Apple siliconrustsecjp-check-macos-aarch64.tar.gzM1 and later
macOS Intelrustsecjp-check-macos-x86_64.tar.gz
Windows x86_64rustsecjp-check-windows-x86_64.zip
ChecksumsSHA256SUMSSHA-256

Verify, or build with Cargo

Check the download first (shasum -a 256 on macOS). Building needs Rust 1.88+.

sha256sum --check --ignore-missing SHA256SUMS
cargo install --locked --git https://github.com/RustSecJP/check

All versions: GitHub Releases

FAQ

Questions

Why does it not check out my code?

It does not need to. Cargo.lock already lists every crate and version, and reading it through the GitHub API means untrusted code from a fork never lands on the runner.

How is this different from cargo audit or cargo deny?

It uses the same kind of advisory data (through OSV) and adds RustSecJP's incident records and look-alike name hints. It is designed around one pull-request comment that stays up to date, and it never needs your project to compile.

Will it comment on pull requests from forks?

On pull_request, GitHub gives fork PRs a read-only token, so the comment may not be posted; the result is still in the job summary. A maintainer can comment @rustsecjp-bot check to post it (see examples/workflow.yml).

Does a look-alike warning mean the crate is malicious?

No. It means the name is close to a popular crate, which is how typosquatting works. Check that it is the crate you meant to depend on. Legitimate look-alikes among the next 4,000 most-downloaded crates are allow-listed to keep the noise down.

What data leaves my repository?

Only names and versions of crates.io dependencies, sent to OSV. RustSecJP/incidents and crates.io are only downloaded from. In Actions, the GitHub API is used to read the lockfile and write the comment.

Why is the report in Japanese?

RustSecJP is a Japanese-speaking community and the tool started there. Everything you need to act on (crate, version, advisory ID, fixed version, links) is language-neutral, and --format json gives a machine-readable report.

Is it free?

Yes. It is open source under MIT or Apache-2.0, at your option, and uses only the GitHub runner and GITHUB_TOKEN: no external service or secret is required.