Loading advisory.
Loading advisory.
Relative Path Traversal in afire serve_static
This vulnerability effects the built-in afire serve_static extension allowing paths containing //.... to bypass the previous path sanitation and request files in higher directories that should not be accessible.
Published 2022-04-22 20:16 UTC · Modified 2022-04-22 20:16 UTC
Severity and EPSS are shown separately. Helm does not combine them into one score.
| Package | Ecosystem | Affected | Fixed in | Upgrade command |
|---|---|---|---|---|
| afire | crates.io | >= 0.2.1, < 1.1.0 | 1.1.0 | cargo add afire@1.1.0 |
This vulnerability effects the built-in afire serve_static extension allowing paths containing //.... to bypass the previous path sanitation and request files in higher directories that should not be accessible.
The issue has been fixed in afire 1.1.0. If you can, just update to the newest version of afire.
If you can't update afire you can simply disallow paths containing /.. with the following middleware.
Make sure this is the last middleware added to the server so it runs first, stopping the bad requests.
use afire::prelude::*;
struct PathTraversalFix;
impl Middleware for PathTraversalFix {
fn pre(&self, req: Request) -> MiddleRequest {
if req.path.replace("\\", "/").contains("/..") {
return MiddleRequest::Send(
Response::new()
.status(400)
.text("Paths containing `..` are not allowed"),
);
}
MiddleRequest::Continue
}
}let mut server = Server::new(host, port);
PathTraversalFix.attach(&mut server);You can read about the new changes to afire in 1.1.0 here
If you have any questions or comments about this advisory you can email me or message me on discord. [https://connorcode.com/contact]
No public exploit code known to Helm's sources (Nuclei templates, Metasploit, Exploit-DB and PoC-in-GitHub). That does not mean none exists.
No EPSS history yet. Either the CVE has no score or the scores have not been fetched.