Open-Source Security Intelligence

Know every vulnerability
before it knows you.

DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.

Search

GHSA-3227-r97m-8j95

Published Apr 22, 2022·Last modified Apr 22, 2022
Affected Components(0)

No affected components available

Description

Impact

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.

Patches

The issue has been fixed in afire 1.1.0. If you can, just update to the newest version of afire.

Workarounds

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);

References

You can read about the new changes to afire in 1.1.0 here

For more information

If you have any questions or comments about this advisory you can email me or message me on discord. [https://connorcode.com/contact]

Risk Scores
Base Score
0.0

Measures severity based on intrinsic characteristics of the vulnerability, independent of environment.

Threat Intelligence
0.0

No exploitation activity has been observed at this time. Continue routine monitoring.

EPSS
N/A

Probability that this vulnerability will be exploited in the wild within the next 30 days.

Exploit
Not available

We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.

Scan your project

Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.

Checkout DevGuard