CVE-2026-133273 in fastify-swagger-uiinfo

Summary

by MITRE • 11/21/2026

@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.

If you want to get the best quality for vulnerability data then you always have to consider VulDB.

Analysis

by VulDB Data Team • 11/21/2026

The vulnerability identified in versions 2.1.0 through 6.1.4 of @fastify/swagger-ui represents a critical misconfiguration in access control logic that undermines the intended security posture of Fastify applications utilizing Swagger UI for API documentation. This plugin is designed to serve interactive API documentation, often containing sensitive details about application endpoints, data structures, and authentication mechanisms. To protect this information from unauthorized access, developers typically register authentication hooks or middleware within their Fastify application instance. These hooks are intended to enforce strict identity verification before any content related to the API specification can be viewed by external clients. However, a flaw in how these security controls were applied allowed for an unintended bypass of these protections under specific configuration conditions.

The core technical flaw lies in the inconsistent application of authentication middleware across different route types managed by the plugin. While the dynamic routes responsible for rendering the Swagger UI interface and handling API specification requests correctly enforced the registered authentication hooks, the static asset serving mechanism was excluded from this security layer. When an operator enables the option to serve bundled user interface files from a local directory rather than relying on remote or default sources, the plugin creates a dedicated route instance to handle these static file requests. This specific route instance operates independently of the application's global authentication middleware chain, effectively creating a backdoor through which protected resources can be accessed without valid credentials.

The operational impact of this vulnerability is significant for organizations that rely on @fastify/swagger-ui to document internal or sensitive APIs. An unauthenticated attacker who possesses knowledge of, or can guess, the filename of an API specification file stored within the configured local directory can directly retrieve its contents via a simple HTTP GET request. This access is read-only and strictly limited to files residing in that specific directory, preventing arbitrary file system traversal beyond those bounds. Nevertheless, the exposure of OpenAPI specifications allows attackers to map out application architecture, identify potential attack vectors, understand data models, and potentially discover undocumented endpoints or sensitive parameters that were not intended for public consumption. This information disclosure facilitates further reconnaissance and could serve as a precursor to more sophisticated attacks such as injection or authentication bypass attempts against the underlying API services.

This vulnerability aligns with CWE-284, which describes Improper Access Control, specifically reflecting scenarios where access control decisions are inconsistently applied across different components of an application. It also relates to CWE-538 regarding File and Directory Information Exposure, as it results in the unauthorized disclosure of internal file contents that were meant to be restricted. From a threat modeling perspective using MITRE ATT&CK frameworks, this flaw facilitates the Reconnaissance phase by allowing adversaries to gather information about networked systems and applications without detection or authentication barriers. The lack of enforcement on static assets creates an asymmetry in security controls that attackers can exploit with minimal effort.

To mitigate this risk, organizations running affected versions must upgrade @fastify/swagger-ui to version 6.1.5 or later immediately. This release corrects the logic error by ensuring that the authentication hooks registered for protecting documentation are also applied to the static asset route instance. By synchronizing access control policies across both dynamic and static content delivery paths, the plugin ensures that all components of the Swagger UI experience remain protected behind the same identity verification gates configured by the application developer. Until this upgrade is performed, operators should consider disabling the local directory serving option or implementing additional external reverse proxy rules to enforce authentication on those specific static file endpoints as a temporary compensating control.

Responsible

Openjs

Reservation

11/19/2026

Disclosure

11/21/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

very low

Sources

Are you interested in using VulDB?

Download the whitepaper to learn more about our service!