CVE-2021-21321: fastify-reply-from - Prefix escape

fastify-reply-from Updated 02 Oct 2025

Summary

03/03/2021
Yes i
Critical
10.0

CVE-2021-21321: Prefix escape. Affects fastify-reply-from versions < 4.0.2. Fixed in 4.0.2. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

fastify-reply-from is an npm package that provides a proxy reply plugin for the Fastify framework. It allows Fastify to proxy requests to another server and send back the response. This package is commonly used in web applications to handle proxying of backend services. However, a vulnerability has been discovered in versions prior to v4.0.2 that allows an attacker to escape the prefix of the proxied backend service.

Vulnerability Detail

The vulnerability arises from a flaw in the URL handling of fastify-reply-from. By crafting a specific URL, an attacker can bypass the expected prefix of the proxied backend service. For example, if the base URL of the proxied server is '/pub/', a user would expect that accessing '/priv' on the target service would not be possible. However, due to this vulnerability, it is possible to access '/priv' and other paths that should be restricted. This can lead to unauthorized access to sensitive information or functionality on the target server. The Common Vulnerability Scoring System (CVSS) score for this vulnerability is 10.0, indicating its critical severity.

How To Fix

Minimum fixed version

4.0.2

This is the first release that contains the fix.

npm install fastify-reply-from@4.0.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There are no known workarounds available for this vulnerability. It is essential to update the package to the fixed version as soon as possible.

Conclusion

The fastify-reply-from package prior to version 4.0.2 is vulnerable to a prefix escape flaw, allowing unauthorized access to the proxied backend service. It is crucial to update the package to version 4.0.2 or later to mitigate this vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for fastify-reply-from →

Share this vulnerability

FAQ

fastify-reply-from is an npm package that provides a proxy reply plugin for the Fastify framework. It allows Fastify to proxy requests to another server and send back the response.

The vulnerability allows an attacker to bypass the prefix of the proxied backend service, potentially gaining unauthorized access to sensitive information or functionality on the target server.

To fix this vulnerability, update fastify-reply-from to version 4.0.2 or later by running 'npm update fastify-reply-from' in the terminal.

No, there are no known workarounds for this vulnerability. Updating the package to the fixed version is the recommended solution.

The severity of this vulnerability is critical, with a CVSS score of 10.0.

How To Fix

Minimum fixed version

4.0.2

This is the first release that contains the fix.

npm install fastify-reply-from@4.0.2

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback