CVE-2026-108551: openapi-typescript-codegen through 0.31.0 Code Injection via Handlebars Templates

Published Oct 10, 2026
·
Updated

openapi-typescript-codegen through 0.31.0 contains a code injection vulnerability that allows attackers controlling an OpenAPI document to inject JavaScript by supplying unescaped values interpolated into single-quoted string literals. Attackers can embed a single quote in path keys, parameter names, servers[0].url, or info.version to execute arbitrary JavaScript when generated clients are imported or service methods called.

Affected Software

1 affected component
npm/openapi-typescript-codegen<=0.31.0

Event History

Oct 10, 2026
CVE Published
via MITRE·02:35 PM
Data Sourced
via MITRE·02:35 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·03:16 PM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to this issue?

Teams that generate clients with openapi-typescript-codegen through 0.31.0 from an OpenAPI document an attacker can control are exposed. The injected JavaScript executes in the environment where the generated client is imported or where affected service methods are called.

2

What does an attacker need to exploit it?

An attacker needs control over values in the OpenAPI document. Exploitable fields include path keys, parameter names, servers[0].url, and info.version, where a single quote can be used to break out of generated single-quoted JavaScript string literals.

3

Does exploitation require authentication or user interaction?

No. The supplied vector indicates network-based exploitation with low complexity, no privileges required, and no user interaction required; the prerequisite is that the attacker can influence the OpenAPI document used for generation.

4

How can we tell whether generated code may be affected?

Review OpenAPI documents used with affected versions for untrusted or unexpected single quotes in path keys, parameter names, servers[0].url, and info.version. Also inspect generated clients for unexpected JavaScript within the corresponding generated string values.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203