Advisory

RUSTSEC-2026-0276

Also known as: GHSA-72g6-wgrg-vhm7, RUSTSEC-2026-0277

Summary

Path traversal in apimock's file-serving fallback

Details

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.

Severity

Not rated by the source.

Dates

Published
2026-08-26 12:00 UTC
Modified
2026-09-02 09:10 UTC

Affected packages and fixes

apimock

crates.io · All systems

Affected

  • introduced 0.0.0-0, fixed 4.8.1, introduced 5.0.0, fixed 5.0.0 (semver)

Fixed versions

4.8.1, 5.0.0

Fix

  • Fixed version 4.8.1
    cargo update -p apimock --precise 4.8.1
  • Fixed version 5.0.0
    cargo update -p apimock --precise 5.0.0

Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.

Check your own computer: guard packages check

View this record on OSV.dev

Source

Source: RustSec Advisory Database · CC0-1.0

Sources & licences