PT-2026-8391 · Crates.Io · Actix-Files

Publicado

2026-02-06

·

Atualizado

2026-02-06

CVSS v4.0

6.3

Média

VetorAV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

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:
rust
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
  1. Clone the https://github.com/actix/examples repository.
  2. Change your directory to the basics/static-files folder.
  3. Edit the src/main.rs file and change the line 13 to mount a non-existing folder:
diff
-    .service(Files::new("/images", "static/images/").show files listing())
+    .service(Files::new("/images", "static/missing/").show files listing())
  1. Run the project with cargo run.
  2. 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.

Correção

Information Disclosure

Encontrou algum problema na descrição? Tem algo a acrescentar? Fique à vontade para nos escrever 👾

Enumeração de Fraquezas

Identificadores relacionados

GHSA-8V2V-WJWG-VX6R

Produtos afetados

Actix-Files