Every CVESearch/Get API key

GHSA-hp8f-xmx4-4qrg

Paths or symlinks ending in a slash escape the sandbox

9.0 CriticalFix available

GHSA-hp8f-xmx4-4qrg is a critical vulnerability (CVSS 9.0) in cap-primitives, published August 20, 2026. No source lists public exploit code. Fixed in cap-primitives 3.4.6.

What does this mean?
Severity
9.0 CriticalCVSS 3.1, OSV
Exploit chance
UnscoredNo EPSS score yet
Exploitation
None knownNot on CISA’s or ENISA’s lists
Fixed in
3.4.6cap-primitives

Description

cap-primitives resolves a path inside a sandboxed directory one component at a time and opens the last component with O_NOFOLLOW, so that a symlink there cannot lead out of the directory. When the path ended in /, the resolver added the slash back to the last component before opening it. With a trailing slash the operating system no longer treats that component as the last one, so O_NOFOLLOW does not apply, the symlink is followed, and the resulting file descriptor was returned without further checks.

A symlink inside the sandbox that points outside it, such as escape -> ../outside or a link to /, can therefore be opened as escape/. If the symlink's own target ends in /, the caller's path does not need a trailing slash at all, so removing trailing slashes from untrusted input is not a workaround. The maintainers' advisory reports reads and writes outside the sandbox through open, open_dir, read_dir and canonicalize, and directory creation, removal and renames outside it through create_dir, remove_dir and rename.

This resolver is used on Windows and macOS, on FreeBSD when O_RESOLVE_BENEATH is not available, and on Linux when openat2 is not available (kernels before 5.6, or a seccomp policy that rejects it). cap-std and other crates built on cap-primitives are affected through it. Wasmtime's WASI filesystem support was affected as well; that is covered by RUSTSEC-2026-0269.

The fix stops re-adding the trailing slash and is in 3.4.6 and 4.0.3.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
None

Affected packages

Affected packages
PackageAffectedFixed
cap-primitives
crates.io
0.0.0-0 up to 3.4.6, 4.0.0 up to 4.0.3
3.4.64.0.3

What each source reports

OSV Score usedRUSTSEC-2026-04829.0

Paths or symlinks ending in a slash escape the sandbox

cap-primitives resolves a path inside a sandboxed directory one component at a time and opens the last component with O_NOFOLLOW, so that a symlink there cannot lead out of the directory. When the path ended in /, the resolver added the slash back to the last component before opening it. With a trailing slash the operating system no longer treats that component as the last one, so O_NOFOLLOW does not apply, the symlink is followed, and the resulting file descriptor was returned without further checks.

A symlink inside the sandbox that points outside it, such as escape -> ../outside or a link to /, can therefore be opened as escape/. If the symlink's own target ends in /, the caller's path does not need a trailing slash at all, so removing trailing slashes from untrusted input is not a workaround. The maintainers' advisory reports reads and writes outside the sandbox through open, open_dir, read_dir and canonicalize, and directory creation, removal and renames outside it through create_dir, remove_dir and rename.

This resolver is used on Windows and macOS, on FreeBSD when O_RESOLVE_BENEATH is not available, and on Linux when openat2 is not available (kernels before 5.6, or a seccomp policy that rejects it). cap-std and other crates built on cap-primitives are affected through it. Wasmtime's WASI filesystem support was affected as well; that is covered by RUSTSEC-2026-0269.

The fix stops re-adding the trailing slash and is in 3.4.6 and 4.0.3.

Record
RUSTSEC-2026-0482
CVSS 3.1
9.0 CriticalCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
Updated
2026-11-11

History

History
RecordedChangedSources
first indexedOSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

References

MoveEnter Open