# GHSA-72g6-wgrg-vhm7: Path traversal in apimock's file-serving fallback

- Severity: not scored yet
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-08-26T12:00:00.000Z
- Modified: 2026-09-02T09:10:39.450Z
- Also known as: RUSTSEC-2026-0276, RUSTSEC-2026-0277

## Description

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.

(As written by RustSec Advisory Database.)

## Affected

- apimock (crates.io): from 0.0.0-0 before 4.8.1; from 5.0.0 before 5.0.0
- apimock-server (crates.io): from 0.0.0-0 before 5.19.1

## References

- <https://crates.io/crates/apimock> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0276.html> (advisory)
- <https://github.com/apimokka/apimock-rs/commit/a9c05fec2d36a750c30e797291a0557f230c8faf> (web)
- <https://crates.io/crates/apimock-server> (package)
- <https://rustsec.org/advisories/RUSTSEC-2026-0277.html> (advisory)
- <https://github.com/apimokka/apimock-rs/commit/ff0dd152ecfccb3bf00e15cc92bd4d57e485c854> (web)

## Sources

- RustSec Advisory Database: [RUSTSEC-2026-0276](https://rustsec.org/advisories/RUSTSEC-2026-0276.html), CC0-1.0, modified 2026-09-02
- RustSec Advisory Database: [RUSTSEC-2026-0277](https://rustsec.org/advisories/RUSTSEC-2026-0277.html), CC0-1.0, modified 2026-09-02

---

Page: https://cve.day/GHSA-72g6-wgrg-vhm7 · Whole record: https://cve.day/GHSA-72g6-wgrg-vhm7.json · Rebuilt by cve.day 2026-11-25T22:56:43.405Z
