@fastify/static vulnerable to path traversal in directory listing
Moderate severity
GitHub Reviewed
Published
Apr 16, 2026
in
fastify/fastify-static
•
Updated Apr 16, 2026
Description
Published by the National Vulnerability Database
Apr 16, 2026
Published to the GitHub Advisory Database
Apr 16, 2026
Reviewed
Apr 16, 2026
Last updated
Apr 16, 2026
Impact
@fastify/staticv9.1.0 and earlier serves directory listings outside the configured static root when thelistoption is enabled. A request such as/public/../outside/causesdirList.path()to resolve a directory outside the root viapath.join()without a containment check.A remote unauthenticated attacker can obtain directory listings for arbitrary directories accessible to the Node.js process, disclosing directory names and filenames that should not be exposed. File contents are not disclosed.
Patches
Upgrade to
@fastify/static>= 9.1.1.Workarounds
Disable directory listing by removing the
listoption from the plugin configuration.References