@fastify/static is vulnerable to Path Traversal
75
High Risk
@fastify/static relies on the find-my-way router to match routes before path normalization, so non-leading .. and %2E%2E path segments are not neutralized before the static plugin's catch-all route handles the request. A request such as /foo/../deep/secret.txt matches the static route instead of a guarded route, bypassing route-based middleware or guards meant to protect those files. The dot-dot segments survive the decodeURI plus encodeURI round-trip and are then collapsed by @fastify/send before its own traversal guard runs. The fix normalizes the pathname so guarded routes match before the file is served.
You are affected if you are using a version that falls within the vulnerable range and you rely on route-based middleware or guards to protect files served by @fastify/static.
@fastify/static is vulnerable to Path Traversal in versions 5.0.0 - 10.1.0.
Upgrade the @fastify/static library to the patch version.
Connect your repositories to instantly see whether vulnerable or malicious packages exist in your codebase.
Free. No credit card required.

I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant