Authentication Bypass Using an Alternate Path or Channel Affecting @fastify/swagger-ui package, versions >=2.1.0 <6.1.5


Severity

Recommended
0.0
medium
0
10

CVSS assessment by Snyk's Security Team. Learn more

Threat Intelligence

EPSS
0.34% (20th percentile)

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk IDSNYK-JS-FASTIFYSWAGGERUI-22744115
  • published23 Nov 2026
  • disclosed21 Nov 2026
  • creditMercury-Redstone Research

Introduced: 21 Nov 2026

NewCVE-2026-133273  (opens in a new tab)
CWE-288  (opens in a new tab)

How to fix?

Upgrade @fastify/swagger-ui to version 6.1.5 or higher.

Overview

@fastify/swagger-ui is a Serve Swagger-ui for Fastify

Affected versions of this package are vulnerable to Authentication Bypass Using an Alternate Path or Channel via the unprotected /static route in lib/routes.js. When the baseDir option is set, the @fastify/static instance mounted at <routePrefix>/static/ is registered without the uiHooks (onRequest and preHandler authentication hooks) that applications configure to protect the documentation. This means every file in baseDir - including API specification files intended to stay behind the documentation login - is reachable by an unauthenticated client who knows or guesses its name at <routePrefix>/static/<file>. Access is read-only and limited to files in that directory, while the /json, /yaml, and UI page routes remain protected.

Workaround

Enforce authentication in a Fastify hook registered before @fastify/swagger-ui so it also runs for the /static route, or do not set baseDir (without it, only the public bundled assets are served under /static/).

CVSS Base Scores

version 4.0
version 3.1