{"id":"GHSA-vc25-qg58-w57c","revision":null,"records":[{"revision":"0a0a9a4162584075af1a47463d9a9660","observedAt":"2026-10-27T11:11:53.252+00:00","statement":{"source":"osv","id":"RUSTSEC-2026-0412","aliases":["GHSA-vc25-qg58-w57c"],"title":"Arbitrary code execution when rerunning tests from a portable recording","description":"## Summary\n\nNextest versions between 0.9.125 and 0.9.149 (inclusive) allow the `cargo nextest run --rerun` (or `-R`) command with a malicious [portable recording](https://nexte.st/docs/features/record-replay-rerun/portable-recordings/) to run arbitrary code during the build. The result is arbitrary code execution with the privileges of the user running `cargo nextest`.\n\nThis vulnerability requires that the experimental [run recording](https://nexte.st/docs/features/record-replay-rerun/) functionality is enabled. An attacker can plausibly trick a victim into enabling this feature.\n\n## Details\n\nNextest's portable recordings contain [build scope arguments](https://nexte.st/docs/design/architecture/recording-runs/#build-scope-arguments). These arguments are deserialized verbatim from portable recordings, and are [not validated](https://github.com/nextest-rs/nextest/blob/70ba2393a05f29c54b72b4badb9635a86f162eb1/nextest-runner/src/record/format.rs#L421-L426). As a result, it is possible to construct an archive with a custom `--config` argument that causes Cargo to execute arbitrary code.\n\nNextest 0.9.150 records the build scope as structured data, and passes each value to Cargo joined to its flag (for example, `--package=<value>`), so a recording can no longer add other Cargo options.\n\n## Impact\n\nA malicious portable recording leads to arbitrary code execution as the user who runs `cargo nextest run --rerun`, during the build phase, before any test runs.\n\n- The injected configuration takes effect during `cargo build`, so the payload is run even on a warm build cache, and even when no tests are ultimately executed. Inspecting the recorded tests (with e.g. `cargo nextest replay`) before running them does not help, since the code has already run by the time the tests would start.\n- Arbitrary code execution happens as the invoking user, without a prompt or trust warning. The only signal is a `rerun: inheriting build scope…` line. On CI, this includes access to whatever secrets are accessible to the job, including repository tokens and deployment credentials.\n- A malicious payload can invoke the real compiler afterwards, so the build and tests complete normally. The recording is otherwise a valid, ordinary recording.\n- The full Cargo `--config` surface is exposed. This includes `build.rustc-wrapper`, `build.rustc`, `target.*.linker`, `target.*.runner`, `env.*`, and `patch.*` and `source.*.replace-with` (redirecting dependencies to an attacker-controlled repository or registry).\n- The delivery mechanism matches the feature's intended use, since portable recordings are designed to be shared across machines. For example, an attacker could pose as a user asking a maintainer for help triaging their flaky test report. Because `--rerun` also accepts process substitution, `cargo nextest run --rerun <(curl …)` would fetch the recording directly from a URL.\n\nExploitation requires convincing the victim to run `cargo nextest run --rerun` against an attacker-supplied portable recording. The rerun feature is experimental and must be enabled, via e.g. `NEXTEST_EXPERIMENTAL_RECORD=1`.\n\n## Remediations\n\n- Upgrade cargo-nextest to version 0.9.150 or above.\n- In your repositories, set the [minimum required version](https://nexte.st/docs/configuration/minimum-versions/) to 0.9.150. In `.config/nextest.toml`:\n  ```toml\n  nextest-version = \"0.9.150\"\n  ```\n  This way, anyone who interacts with your repository will be notified to upgrade their version of nextest.\n- If you are using an affected version, do not enable the experimental run recording feature.\n\n## Credit\n\nReported by [inanna-malick](https://github.com/inanna-malick).","state":0,"publishedAt":"2026-10-26T12:00:00+00:00","modifiedAt":"2026-10-27T10:00:02.6860499+00:00","affected":[{"ecosystem":"crates.io","name":"cargo-nextest","ranges":[{"type":"SEMVER","events":[{"kind":"introduced","version":"0.9.125"},{"kind":"fixed","version":"0.9.150"}]}],"versions":[],"rawVersionEvidence":null}],"metrics":[{"system":"CVSS_V3","vector":"CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H","score":null,"severity":null}],"references":["https://crates.io/crates/cargo-nextest","https://rustsec.org/advisories/RUSTSEC-2026-0412.html","https://github.com/nextest-rs/nextest/commit/456818b35d906551b2273e635c9b343704caaeaf","https://github.com/nextest-rs/nextest/commit/59ef7afc7887caea50aabed289756820e08f366a","https://nexte.st/changelog/#0.9.150"],"sourceUrl":"https://osv.dev/vulnerability/RUSTSEC-2026-0412","license":"OSV · upstream source license applies","key":"osv:RUSTSEC-2026-0412","identifiers":["RUSTSEC-2026-0412","GHSA-vc25-qg58-w57c"]},"retained":false,"historicalAffected":[]}],"coverage":[{"source":"cisa-kev:global","scope":"Complete CISA KEV catalog; all vendors. Missing entries do not establish absence of exploitation.","generation":"2026-11-01T10:22:10.8271196+00:00","complete":true,"records":1766,"lastAttemptAt":"2026-11-01T10:22:10.8271196+00:00","lastSuccessAt":"2026-11-01T10:22:11.2247813+00:00","error":null,"lastVerifiedAt":"2026-11-01T10:22:11.2249206+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"cve-program","scope":"Official CVE Program baseline and cumulative hourly delta; all vendors, published and rejected records","generation":"cve-aece262bb10a694367a43c24d730aa8e8dc171723eaec4c15cdd32f04bda103f-9e1a559aee9cc1bc69e9114987d385dde42a0e8c6e2f12d0d04cffad8855f679","complete":true,"records":417622,"lastAttemptAt":"2026-11-01T10:22:09.5022451+00:00","lastSuccessAt":"2026-11-01T10:04:51.247796+00:00","error":null,"lastVerifiedAt":"2026-11-01T10:22:09.5022451+00:00","snapshotPublishedAt":"2026-11-01T09:26:40+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"euvd","scope":"Rolling EUVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global EUVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-c29f775e385a4a98bb6a5a4ebeb74c55","complete":true,"records":13567,"lastAttemptAt":"2026-11-01T10:24:06.6731186+00:00","lastSuccessAt":"2026-11-01T10:24:06.669+00:00","error":null,"lastVerifiedAt":"2026-11-01T10:24:06.669+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13637,"expectedIdentifiers":13637,"failedIdentifiers":0},{"source":"first-epss:nuget","scope":"FIRST EPSS for explicit CVE aliases in the collected public NuGet archive. Not a global EPSS backfill.","generation":"2026-11-01T10:22:10.8271196+00:00","complete":true,"records":1095,"lastAttemptAt":"2026-11-01T10:22:10.8271196+00:00","lastSuccessAt":"2026-11-01T10:22:11.3889465+00:00","error":null,"lastVerifiedAt":"2026-11-01T10:22:11.3889472+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"nvd","scope":"Rolling NVD lookups of CVE aliases in current public OSV archives; 500 identifiers per refresh, rechecked after 48 hours. Not a global NVD catalog. Successful not-found lookups count as checked; they do not imply withdrawal or safety. No reader inventory is sent.","generation":"enrichment-cb479fb73dd0432cb8c82ee43f01837b","complete":true,"records":13580,"lastAttemptAt":"2026-11-01T10:22:12.2055722+00:00","lastSuccessAt":"2026-11-01T04:04:52.54+00:00","error":null,"lastVerifiedAt":"2026-11-01T04:04:52.54+00:00","snapshotPublishedAt":null,"importing":false,"stagedRecords":0,"checkedIdentifiers":13637,"expectedIdentifiers":13637,"failedIdentifiers":0},{"source":"osv:Go","scope":"Complete OSV Go ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"go-21dcd6662970dfea02e4ea60ee637115e8d92664947484d2b9276b3f6568a84f","complete":true,"records":9815,"lastAttemptAt":"2026-11-01T10:22:10.2904534+00:00","lastSuccessAt":"2026-10-30T23:47:34.1817587+00:00","error":null,"lastVerifiedAt":"2026-11-01T10:22:10.2904534+00:00","snapshotPublishedAt":"2026-10-30T23:33:17+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:NuGet","scope":"Complete OSV NuGet ecosystem archive, including GitHub Advisory Database records; NuGet version matching only","generation":"nuget-2de9ccc5290f060c7aa63f89c25dd76f655a64ba1aba7c05c97fa3bee4f09899","complete":true,"records":1967,"lastAttemptAt":"2026-11-01T10:22:09.6513935+00:00","lastSuccessAt":"2026-10-28T20:55:34.2982937+00:00","error":null,"lastVerifiedAt":"2026-11-01T10:22:09.6513935+00:00","snapshotPublishedAt":"2026-10-28T20:03:08+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:crates.io","scope":"Complete OSV crates.io ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"crates.io-f95f76cd406ae5bae3de632ad37fd2d5160b44f5e6b51748ac6f8f0c0c88e72b","complete":true,"records":3028,"lastAttemptAt":"2026-11-01T10:22:10.680814+00:00","lastSuccessAt":"2026-10-30T23:47:38.4914494+00:00","error":null,"lastVerifiedAt":"2026-11-01T10:22:10.680814+00:00","snapshotPublishedAt":"2026-10-30T23:18:12+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null},{"source":"osv:npm","scope":"Complete OSV npm ecosystem archive, including withdrawn and malicious-package source records; statement counts are not unique CVE counts","generation":"npm-55acacd40a7aab88cf530cfddf98233a5d800cfc6bb1883653ecf5bee50f4426","complete":true,"records":230996,"lastAttemptAt":"2026-11-01T10:22:10.1799436+00:00","lastSuccessAt":"2026-11-01T09:06:49.6961926+00:00","error":null,"lastVerifiedAt":"2026-11-01T10:22:10.1799436+00:00","snapshotPublishedAt":"2026-11-01T08:33:39+00:00","importing":false,"stagedRecords":0,"checkedIdentifiers":null,"expectedIdentifiers":null,"failedIdentifiers":null}]}