Fastify Swagger UI auth bypass via unprotected static route in API docs
Affects @fastify/swagger-ui 2.1.0 through 6.1.4 when uiHooks protect the docs and baseDir is set to serve files from a local directory. Fixed in 6.1.5.
- Exploited
- No known exploitation
- Fix
- Fixed in 6.1.5
- Who is exposed
- Specific setups only
Summary
The @fastify/swagger-ui plugin, which serves Swagger UI documentation for Fastify applications, can let a remote client without logging in read files in the local directory it serves bundled UI files from, bypassing the login meant to protect the documentation. An attacker must know or guess a file's name, but once they do, they can read a specification file that was meant to stay behind that login.
Written by a model
Original description
@fastify/swagger-ui is the plugin that serves Swagger UI documentation for Fastify applications. In versions 2.1.0 through 6.1.4, the authentication hooks that applications register to protect the documentation are applied to every route the plugin adds except the bundled static asset instance. When the option that serves bundled UI files from a local directory is enabled, that instance exposes every file in the directory without credentials, so a specification file an operator meant to keep behind the documentation login becomes reachable by an unauthenticated client who knows or guesses its name. Access is read-only and limited to files in that directory. The issue is fixed in @fastify/swagger-ui 6.1.5, which applies the same authentication hooks to the static asset route, and users should upgrade to 6.1.5 or later.
Who should check
Teams running @fastify/swagger-ui 2.1.0 through 6.1.4 with uiHooks auth and baseDir set to serve bundled UI files from a local directory
“When baseDir is set, which the README recommends for bundling the UI”
What to do
Check whether your setup matches what the bug needs.
Application registers uiHooks authentication hooks to protect the documentation The baseDir option is set so the plugin serves files from a local directory Affected versions are 2.1.0 through 6.1.4Upgrade to a fixed version: 6.1.5.
Check your systems with an agent
Paste this into a coding or ops agent. It checks your systems read-only and reports a table per asset.
Check whether my systems are affected by CVE-2026-133273 (@fastify/swagger-ui vulnerable to documentation authentication bypass via the unprotected /static route), using the cve.now data below.
Rules: work read-only. Do not run exploit code, proof-of-concept scripts or scanners that send attack payloads, and do not change any configuration, package, image or deployment. Report findings only.
What cve.now has for CVE-2026-133273 (entry last updated 2026-11-21):
Affected:
- npm package @fastify/swagger-ui: from 2.1.0, fixed in 6.1.5
Fixed versions: 6.1.5.
Conditions (all must be true for the bug to be hit):
- Application registers uiHooks authentication hooks to protect the documentation (source: https://github.com/fastify/fastify-swagger-ui/security/advisories/GHSA-j7qm-jhpc-mj26)
- The baseDir option is set so the plugin serves files from a local directory (source: https://github.com/fastify/fastify-swagger-ui/security/advisories/GHSA-j7qm-jhpc-mj26)
- Affected versions are 2.1.0 through 6.1.4 (source: https://github.com/fastify/fastify-swagger-ui/security/advisories/GHSA-j7qm-jhpc-mj26)
Setup: the bug needs a feature or setting that is off by default or uncommon. Check whether each asset has it on.
Attacker needs: network access, no login, no user action.
CISA KEV: CVE-2026-133273 is not listed as of cve.now's last read.
This KEV status is for CVE-2026-133273 only. If you also check another CVE, look up its own KEV status; never assume it from this one.
How to check:
- Packages (npm): find every lockfile in each project and run the stack.check operation of the cve.now MCP server (execute) on each one. Compare the resolved versions, not the ranges a manifest declares, with the affected versions above. Include transitive dependencies.
Verify against the linked advisories before concluding, and cite the date you read each one:
- https://github.com/fastify/fastify-swagger-ui/security/advisories/GHSA-j7qm-jhpc-mj26
- https://cna.openjsf.org/security-advisories.html
Do not conclude an asset is unaffected unless you checked it and the evidence covers both its version and the conditions above. If you could not check something, mark it unknown and say what is missing.
Report a table with one row per asset and these columns: Asset | Version or build | Status (affected, fixed, not applicable, unknown) | Compensating controls | Exposure (internet-facing, internal, none) | Evidence | Next action.
Entry: https://cve.now/CVE-2026-133273
For follow-up questions, use the cve.now MCP server at https://mcp.cve.now/mcp (no authentication), for example execute with name cve.get and arguments {"id": "CVE-2026-133273"}.Affected versions
cve.now Index
- Exploitation?/40Unknown. No CISA SSVC exploitation rating yet
- Exposure12/25Specific setups only, reachable over the network without a login
- Reach16/20@fastify/swagger-ui: 2.3M downloads a week
- Severity3.7/10CVSS 3.7
- No patch0/5No signal
What would change the score
- Would score about 82 if added to CISA KEV
- Would score about 77 if CISA's SSVC rates exploitation active
Impact
Timeline
- CVE published
- First seen by cve.now
Evidence 4
| Kind | Source |
|---|---|
| Vendor advisory 1Establishes: Affected and fixed versions. | |
| Advisory | GitHub · fastify/fastify-swagger-ui · Advisory GHSA-j7qm-jhpc-mj26 |
| CVE record 2Establishes: The identifier and description. | |
| Record | CVE List · CVE-2026-133273 |
| Record | NVD · CVE-2026-133273 |
| Other links 1 | |
| Link | cna.openjsf.org · security-advisories.html |
Questions about CVE-2026-133273
Is CVE-2026-133273 being exploited?
It is not in CISA's Known Exploited Vulnerabilities catalog, and CISA's SSVC assessment does not mark exploitation as active. That does not mean it has not been attacked: vendors and researchers can report attacks before CISA lists them. No public exploit code is tracked.
Source: cve.now feed data
What does this mean?
The documentation's protection can be bypassed through the unprotected /static route, so an unauthenticated client can read specification files that were meant to stay behind the documentation login. Access is read-only and limited to files in the directory.
Source: github.com
Which versions are affected by CVE-2026-133273?
@fastify/swagger-ui (npm): from 2.1.0 before 6.1.5.
Source: cve.now feed data
Am I affected, and how do I check?
Versions 2.1.0 through 6.1.4 are affected, and only when the application uses uiHooks to protect the documentation and sets the baseDir option. Check the installed @fastify/swagger-ui version in your package.json or lockfile, and check whether baseDir is set where the plugin is registered.
Source: github.com
How do I fix CVE-2026-133273?
Upgrade @fastify/swagger-ui to 6.1.5 or later, which is the fixed version.
Source: github.com
Related
- CVE-2024-22207Default swagger-ui configuration exposes all files in the module
- CVE-2026-129073WordPress miniorange otp verification plugin <= 5.6.1 - Broken Authentication vulnerability
- CVE-2026-123890vCenter authentication-bypass vulnerability
- CVE-2026-85844Windows Kerberos Elevation of Privilege Vulnerability
- CVE-2026-111264Apache TomEE: Authentication bypass on EJB web service endpoints via HTTP method
- CVE-2026-126755ArangoDB < 3.12.11 Authentication Bypass via URL-Encoded Underscore
No corrections so far. Something wrong on this page? Report an error.