# CVE-2021-22964: fastify-static open redirect and DOS with user input

Source: https://junglewise.ai/threats/cve-2021-22964-fastify-static-open-redirect-and-dos-with-user-input  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-10-12. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2021-22964 · Severity: low · CVSS 3.1 · Published 2021-10-12

fastify-static is a Fastify plugin that serves static files and can optionally redirect requests. When the redirect option is enabled, the module fails to properly validate user-supplied URLs, allowing attackers to redirect users to arbitrary websites or trigger denial-of-service conditions by including malicious input like double slashes or invalid characters in the request path.

Technologies: [@fastify/static (npm)](https://junglewise.ai/threats/technologies/fastify-static). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2021-22964 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-22964 being exploited in the wild.

**How severe is CVE-2021-22964?** Low severity, with a CVSS score of 3.1, published 12 October 2021.

**Which products and versions are affected?** @fastify/static (npm) SEMVER:introduced=4.2.4,fixed=4.4.1.

**Is there a fix for CVE-2021-22964?** Yes. @fastify/static (npm): upgrade to 4.4.1 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2021-22964 attacked?** It is attacked over the network.

**Am I affected by CVE-2021-22964?** Check whether you run @fastify/static (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @fastify/static (npm): upgrade to 4.4.1 or later

  ```sh
  npm install @fastify/static@4.4.1
  ```


## Technical details

fastify-static versions 4.2.4 through 4.4.0 contain an open redirect vulnerability (CWE-601) and denial-of-service vulnerability (CWE-248) when the redirect option is enabled. The vulnerability stems from improper URL validation and path normalization in the redirect handler. An attacker can craft a malicious URL using double slashes (e.g., //a//youtube.com/) or invalid characters (e.g., //^/..) to either redirect users in Mozilla Firefox to attacker-controlled domains or cause the application to throw an uncaught exception resulting in a denial of service. The attack requires user interaction (clicking a malicious link) but affects all applications with redirect: true configured. The vulnerability has been patched in version 4.4.1 and can be mitigated by disabling redirects or sanitizing input URLs with the rewriteUrl option.

## Affected products

- Fastify fastify-static 4.2.4 to 4.4.0

## Identifiers

- CVE-2021-22964
- GHSA-pgh6-m65r-2rhq

## Timeline

- 2021-10-11: disclosed
- 2021-10-11: patched: fastify-static 4.4.1

## References

- [https://github.com/fastify/fastify-static/security/advisories/GHSA-pgh6-m65r-2rhq](https://github.com/fastify/fastify-static/security/advisories/GHSA-pgh6-m65r-2rhq)

## Related threats

- [Fastify @fastify/static authorization bypass via non-canonical paths](https://junglewise.ai/threats/cve-2026-7120-fastify-fastify-static-authorization-bypass-via-non-canonical)
- [Fastify @fastify/static route guard bypass via path traversal](https://junglewise.ai/threats/cve-2026-15074-fastify-fastify-static-route-guard-bypass-via-path-traversal)
- [Fastify @fastify/static path traversal in directory listing](https://junglewise.ai/threats/cve-2026-6410-fastify-fastify-static-path-traversal-in-directory-listing)
- [Fastify @fastify/static route guard bypass via encoded path separators](https://junglewise.ai/threats/cve-2026-6414-fastify-fastify-static-route-guard-bypass-via-encoded-path)
- [Fastify fastify-static open redirect](https://junglewise.ai/threats/cve-2021-22963-fastify-fastify-static-open-redirect)
