Email me

Rust advisories / apimock

VulnerabilityRUSTSEC-2026-0276 · apimock

RUSTSEC-2026-0276: Path traversal in apimock's file-serving fallback

Short answerA security vulnerability in the apimock crate: Path traversal in apimock's file-serving fallback. No severity score was published. Fixed in 4.8.1, 5.0.0: update to a fixed version.

Crateapimock
TypeVulnerability (file-disclosure)
Affected versionsBefore 4.8.1; from 5.0.0 before 5.0.0.
Fixed in4.8.1, 5.0.0
Severitynot scored
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
Published2026-08-26
Last changed2026-09-02
Also known asGHSA-72g6-wgrg-vhm7, RUSTSEC-2026-0277

What to do

  1. See which version you have: cargo tree -i apimock (it also shows which of your dependencies pulls it in).
  2. Update within your version requirement: cargo update -p apimock. If the fix is a newer major or minor than your requirement allows, raise it in Cargo.toml (for example apimock = "5.0.0") or update the dependency that pulls it in.
  3. Check again with cargo audit, or paste your Cargo.lock into our Cargo.toml checker.

Details from the advisory

The file-serving fallback joined a request-derived path onto the configured response directory and checked only that the result existed, never that it stayed inside that directory. A request containing a raw .. segment could read any file readable by the process, returned with HTTP 200.

Read-only: no write, no code execution.

On the 4.x line apimock is a single crate containing the serving code. Fixed in 4.8.1 by canonicalising each resolved path and rejecting anything outside its base directory.

**apimock 5.0.0 and later are not affected by this advisory.** From 5.0.0 the serving code moved to the apimock-server crate, which apimock depends on; that crate carries its own advisory for the same issue, fixed in 5.19.1.

References

From the RustSec Advisory Database (CC0-1.0) via the OSV export, downloaded Oct 24, 2026. Severity score computed from the published CVSS vector.

Up next

Are you affected?Check your whole dependency treePaste Cargo.lock: every advisory, for your exact versions.Read it next →

Did this answer your question?

Get the receipts by email.

What my AI agents tried this week, with the real numbers: what worked, what flopped, what made money. One email when there is something worth reading.

No spam, never sold. Every email has a one-click unsubscribe.

Popular in the shop

All 124 tools →

Browse: Bundles and kitsHome, family and schoolMoney and businessAI toolsSports and fitnessMaking and hobbiesFood and drinkIndie dev and launchTrading and quant

Free: Landing page teardown iPhone app cost calculator LLM API cost calculator Paid online: $49 Launch Check App builds Articles FAQ