actix-files has a possible exposure of information vulnerabilityGHSA-8v2v-wjwg-vx6r
GHSA-8v2v-wjwg-vx6r is a Path Traversal vulnerability in actix-files. A fix is available for actix-files — see the affected versions and patch details below.
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for GHSA-8v2v-wjwg-vx6r.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
actix-filesReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects crates.io packages — download data is not available via public APIs for these ecosystems.
Description
Summary
When passing a non-existing folder to the actix_files::Files::new() method causes the actix server to expose unexpected files.
Details
The actix-files library exposes a Files struct that configures an actix service to serve the files in a folder as static assets. Below you can find the signature of the Files::new method:
pub fn new<T: Into<PathBuf>>(mount_path: &str, serve_from: T) -> Files
When the mount_path you pass to Files doesn't exist, it defaults to an empty path (Path::new()). When the service receives a HTTP request, it joins the request information with the empty path and calls canonicalize. Rust resolves this path as relative and returns any file that matches it.
This behavior causes the library to expose unexpected files when the folder is not present.
PoC
There is a working PoC on https://github.com/Angelmmiguel/actix-files-vuln, although the next steps can be followed to reproduce the issue
-
Clone the https://github.com/actix/examples repository.
-
Change your directory to the
basics/static-filesfolder. -
Edit the
src/main.rsfile and change the line 13 to mount a non-existing folder:- .service(Files::new("/images", "static/images/").show_files_listing()) + .service(Files::new("/images", "static/missing/").show_files_listing()) -
Run the project with
cargo run. -
Access the http://localhost:8080/images/Cargo.toml URL.
Impact
This is an exposure of information vulnerability. It affects anyone using the actix-files::Files library that mounts a non-existing folder for any reason.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 🦀crates.io | actix-files | all versions | 0.6.10cargo update -p actix-files --precise 0.6.10 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for actix-files, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update actix-files to 0.6.10 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-8v2v-wjwg-vx6r is resolved across your whole dependency graph.
Workarounds
Resolve every user-supplied path to its canonical form and reject anything that escapes the intended directory, and run the component under an account that has no read or write access outside the directory it legitimately serves.
Fixing This On Your OS
If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.
This Moderate impact information disclosure flaw in the `actix-files` crate allows an attacker to access unintended files relative to the application's working directory. This occurs when a non-existing folder is incorrectly provided as the `serve_from` argument to `Files::new()`, causing the service to resolve paths…
To mitigate this issue, ensure that any directory specified for the `serve_from` argument in applications utilizing the `actix-files` crate exists prior to application startup. This prevents the vulnerable condition where a non-existent path causes the service to default to an empty mount path, leading to unintended relative path traversal and information disclosure.Source: Red Hat security advisory for GHSA-8v2v-wjwg-vx6r (CC BY 4.0)
Frequently Asked Questions
Is GHSA-8v2v-wjwg-vx6r in your dependencies?
Find it across crates.io, including transitive dependencies.