Vulnerability DatabaseCVE-2026-133273

CVE-2026-133273: 
JavaScript vulnerability analysis and mitigation

Overview

CVE-2026-133273 is an authentication bypass vulnerability in @fastify/swagger-ui that allows unauthenticated clients to access protected API specification files via the unprotected /static route. The vulnerability affects versions 2.1.0 through 6.1.4 of the npm package and was patched in version 6.1.5. It was published on November 20, 2026 by maintainer mcollina. It carries a CVSS v3.1 base score of 3.7 (Low) (GitHub Advisory).

Technical details

The root cause is an incomplete application of authentication hooks (CWE-288: Authentication Bypass Using an Alternate Path or Channel). When baseDir is configured — as recommended in the README for bundling the Swagger UI — the @fastify/static instance mounted at /static/ serves all files in baseDir without applying the uiHooks (onRequest and preHandler) that protect the main documentation routes. This means any file accessible at the protected root path / is also reachable unauthenticated at /static/<filename> if an attacker knows or guesses the filename. The /json, /yaml, and UI page routes remain protected; only the static file serving path is affected (GitHub Advisory).

Impact

Exploitation allows an unauthenticated remote attacker to read API specification files (e.g., OpenAPI/Swagger definitions) that operators intended to protect behind documentation authentication. Access is strictly read-only — there is no integrity or availability impact. Exposed specification files may reveal internal API structure, endpoint details, authentication schemes, or sensitive parameter names, potentially aiding further reconnaissance or targeted attacks against the application (GitHub Advisory).

Exploitability

No public exploit code, active in-the-wild exploitation, or threat actor attribution has been reported for this vulnerability. The attack complexity is rated High, as an attacker must know or correctly guess the filename of a protected specification file. The vulnerability requires no privileges or user interaction and is remotely exploitable over the network. No EPSS score or CISA KEV catalog entry is currently associated with this CVE (GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify a target application using @fastify/swagger-ui versions 2.1.0–6.1.4 with baseDir configured, and where documentation authentication (e.g., bearer token, API key header) is enforced via uiHooks.
  2. Confirm authentication on main routes: Attempt to access the Swagger UI at the root path (e.g., /documentation) and confirm a 401/403 response, verifying that authentication is enforced.
  3. Guess or enumerate filenames: Attempt to access common OpenAPI specification filenames directly via the /static/ path, such as /documentation/static/swagger.json, /documentation/static/openapi.yaml, or other known bundled asset names.
  4. Retrieve protected specification: A successful unauthenticated HTTP GET request to /documentation/static/<specfile> returns the file contents without requiring credentials, exposing the API specification (GitHub Advisory).

Indicators of compromise

  • Network: Unauthenticated HTTP GET requests to paths matching /*/static/*.json, /*/static/*.yaml, or /*/static/*.yml from external or unexpected IP addresses, particularly without accompanying authentication headers.
  • Logs: Web server or Fastify access logs showing 200 OK responses to /static/ sub-paths for specification files from clients that received 401/403 on the main documentation route; absence of Authorization or session cookie headers in those requests.
  • Behavioral: Repeated or scripted requests to /static/ with varying filenames suggesting enumeration attempts (GitHub Advisory).

Mitigation and workarounds

Upgrade @fastify/swagger-ui to version 6.1.5 or later, which applies uiHooks to the /static route as well as all other plugin routes. If immediate upgrade is not possible, two workarounds are available: (1) register a Fastify authentication hook at a scope that covers the /static route before registering @fastify/swagger-ui, or (2) remove the baseDir configuration — without it, only the public bundled assets (not operator-supplied files) are served under /static/. Note that header-only bearer authentication schemes may require additional configuration after upgrading, as browsers send same-origin credentials automatically for basic/cookie auth but not for injected headers (GitHub Advisory).

Community reactions

The advisory was published by Fastify maintainer mcollina with AI assistance, and remediation was developed by UlisesGascon and reviewed by mcollina. The advisory references a prior related vulnerability, GHSA-62jr-84gf-wmg4 (CVE-2024-22207), which was an earlier file exposure issue in @fastify/swagger-ui's static serving, indicating a pattern of scrutiny on this component's static file handling (GitHub Advisory). No broader media coverage or notable community discussion has been identified at this time.

Additional resources


Source: This report was generated using AI

Related JavaScript vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-133867CRITICAL9.1
  • JavaScript logoJavaScript
  • @fastify/express
NoYesNov 21, 2026
CVE-2026-133250CRITICAL9.1
  • JavaScript logoJavaScript
  • @fastify/middie
NoYesNov 21, 2026
CVE-2026-133120CRITICAL9.1
  • JavaScript logoJavaScript
  • @fastify/express
NoYesNov 21, 2026
CVE-2026-133312MEDIUM5.3
  • JavaScript logoJavaScript
  • @fastify/rate-limit
NoYesNov 21, 2026
CVE-2026-133273LOW3.7
  • JavaScript logoJavaScript
  • @fastify/swagger-ui
NoYesNov 21, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Additional Wiz resources

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management