Executive brief
swagger-typescript-api is a tool used by developers to automatically generate code for interacting with web services. A security flaw allows a malicious API specification file to trick the tool into sending the developer's private authentication tokens (such as GitHub or corporate login tokens) to an attacker-controlled server. This could lead to the theft of sensitive credentials used in development or automated build environments.
Technical details
The vulnerability exists in the remote schema resolution logic within `src/resolved-swagger-schema.ts`. When the `--authorizationToken` flag is used, the `getRemoteRequestHeaders` function attaches the token to every HTTP request made by `fetchRemoteSchemaDocument`. Because `warmUpRemoteSchemasCache` resolves external `$ref` URLs without performing same-origin checks, an attacker can craft an OpenAPI specification that includes a reference to an external, attacker-controlled domain. When a developer or CI/CD pipeline processes this malicious spec, the bearer token is exfiltrated to the attacker's server. This issue is fixed in version 13.12.2 by enforcing same-origin checks for token forwarding.
Affected products
- acacode swagger-typescript-api < 13.12.2
Timeline
- 2026-06-08: patched: Fixed in version 13.12.2
- 2026-07-29: disclosed: CVE-2026-54660 published
References
- https://github.com/acacode/swagger-typescript-api/commit/306d59acb8ffbb00f953f807b97234b21f51d9de
- https://github.com/acacode/swagger-typescript-api/pull/1779
- https://github.com/acacode/swagger-typescript-api/releases/tag/v13.12.2
- https://github.com/acacode/swagger-typescript-api/security/advisories/GHSA-h754-fxp7-88wx