swagger-typescript-api npm Package Code Injection Vulnerability
The swagger-typescript-api npm package is under investigation for a potential code injection vulnerability due to an unescaped URL in the axios http-client template.
What happened
An early warning has been issued regarding a potential code injection vulnerability in the swagger-typescript-api npm package. The issue reportedly arises from the interpolation of an unescaped URL directly into a TypeScript string literal, which could allow an attacker to execute arbitrary code with the importing process's privileges. This vulnerability appears to affect all versions of the package up to and including 13.12.2. The recommended action is to upgrade to a version where the `apiConfig.baseUrl` is sanitized or to apply a custom fix to sanitize the `apiConfig.baseUrl` in `src/code-gen-process.ts`. For more details, consult the primary sources.
How 0Day mitigates this
swagger-typescript-api is anywhere in your dependency tree, the engineers who own the affected repositories get a push alert the moment it is flagged — no manual audit to remember to run.Read how this differs from waiting on a scanner to catch a known advisory, or see the exact, read-only access 0Day needs to do this for an organization.