QID 980374

QID 980374: Nodejs (npm) Security Update for fastify-static (GHSA-pgh6-m65r-2rhq)

Security update has been released for fastify-static to fix the vulnerability.

Note: The preceding description block is extracted directly from the security advisory. Using automation, we have attempted to clean and format it as much as possible without introducing additional issues.

A redirect vulnerability in the `fastify-static` module allows remote attackers to redirect Mozilla Firefox users to arbitrary websites via a double slash `//` followed by a domain: `http://localhost:3000//a//youtube.com/%2e%2e%2f%2e%2e`.

A DOS vulnerability is possible if the URL contains invalid characters `curl --path-as-is "http://localhost:3000//^/.."`

The issue shows up on all the `fastify-static` applications that set `redirect: true` option. By default, it is `false`.

  • CVSS V3 rated as Critical - 8.8 severity.
  • CVSS V2 rated as High - 6.8 severity.
  • Solution
    The issue has been patched in `[email protected]`Workaround:
    If updating is not an option, you can sanitize the input URLs using the [`rewriteUrl`](https://www.fastify.io/docs/latest/Server/#rewriteurl) server option.
    Vendor References

    CVEs related to QID 980374

    Software Advisories
    Advisory ID Software Component Link
    GHSA-pgh6-m65r-2rhq fastify-static URL Logo github.com/advisories/GHSA-pgh6-m65r-2rhq