CVE-2026-59730: @astrojs/node - Backslash-Prefixed Paths Not Recognized as Internal by Trailing-Slash Redirect
Summary
CVE-2026-59730: @astrojs/node: Backslash-prefixed paths not recognized as internal by trailing-slash redirect. Affects @astrojs/node versions >= 8.1.0, < 11.0.2. Fixed in 11.0.2. How to fix ↓
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.
No signup required · Results in about 60 seconds
Background
The @astrojs/node package is a standalone server for serving static files in Astro applications. It is designed to enhance the performance and efficiency of web applications by providing a streamlined way to handle static assets. However, a specific configuration related to trailing slashes can lead to vulnerabilities if not properly managed.
Vulnerability Detail
The vulnerability arises when the trailingSlash option is set to 'always'. In this scenario, the static file handler appends a trailing slash to request paths and issues a 301 redirect. However, paths that begin with a backslash (/) are not recognized as internal paths, causing the handler to return the raw path in the Location header. This can lead to a situation where the redirect resolves to an external host, potentially exposing users to phishing attacks or other malicious activities. Preconditions for this vulnerability include the trailingSlash option being set to 'always', the request path lacking a file extension, and an attacker delivering a crafted link to a user.
How To Fix
Minimum fixed version
11.0.2
This is the first release that contains the fix.
npm install @astrojs/node@11.0.2
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
As a temporary workaround, you can set the trailingSlash option to 'ignore'. This can be done in your configuration file as follows: trailingSlash: 'ignore'. This setting prevents the static file handler from issuing trailing-slash redirects, thereby mitigating the risk associated with this vulnerability.
Conclusion
In summary, the CVE-2026-59730 vulnerability in the @astrojs/node package can lead to serious security risks if the trailingSlash option is set to 'always'. It is crucial to update to the patched version or implement the recommended workaround to protect your application from potential exploits.
See every vulnerability recorded for @astrojs/node →
FAQ
The vulnerability can lead to unintended redirects to external hosts, potentially exposing users to phishing attacks.
You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.
If you cannot update the package right away, consider using the workaround of setting trailingSlash to 'ignore' to mitigate the risk.
Yes, Vulert can monitor your project for open-source vulnerabilities in real-time using just the package-lock.json file.
The CVSS score of this vulnerability is 2.1, indicating a low severity level.
References
Related vulnerabilities
Recent vulnerabilities recorded for @astrojs/node.