# CVE-2026-23947: Orval code injection via unsanitized x-enum-descriptions

Source: https://junglewise.ai/threats/cve-2026-23947-orval-code-injection-via-unsanitized-x-enum-descriptions  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-01-21. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-23947 · Severity: medium · CVSS 4 · Published 2026-01-21

Orval is a code generation tool that creates API client libraries from OpenAPI specifications. The tool fails to properly escape metadata fields when generating TypeScript/JavaScript enum code, allowing attackers who control the API specification to inject arbitrary code that executes during client generation. This could lead to complete compromise of any system using Orval to generate clients from untrusted API specifications.

Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2026-23947 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-23947 being exploited in the wild.

**How severe is CVE-2026-23947?** Medium severity, with a CVSS score of 4, published 21 January 2026.

**Which products and versions are affected?** @orval/core (npm) SEMVER:introduced=8.0.0-rc.0,fixed=8.0.2.

**Is there a fix for CVE-2026-23947?** Yes. @orval/core (npm): upgrade to 8.0.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-23947 attacked?** It is attacked over the network.

**Am I affected by CVE-2026-23947?** Check whether you run @orval/core (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- @orval/core (npm): upgrade to 8.0.2 or later

  ```sh
  npm install @orval/core@8.0.2
  ```


## Technical details

The vulnerability is a code injection flaw (CWE-94) in the getEnumImplementation() function of @orval/core. The x-enumDescriptions field from OpenAPI specifications is embedded directly into generated TypeScript/JavaScript enum code without sanitization or escaping. An attacker can craft a malicious OpenAPI specification containing JavaScript code within the x-enumDescriptions field (e.g., `require('child_process').execSync()`), which will be executed in the generated schema files when the code is generated. The attack requires an attacker to control or influence the OpenAPI specification consumed by Orval, but requires no authentication or user interaction beyond running the generation tool. Patches are available in versions 7.19.0 and 8.0.2.

## Affected products

- Orval Labs @orval/core All versions before 7.19.0 and 8.0.0-rc.0 through before 8.0.2

## Identifiers

- CVE-2026-23947
- GHSA-h526-wf6g-67jv

## Timeline

- 2026-01-21: disclosed: GHSA published
- 2026-01-21: patched: Fixed in versions 7.19.0 and 8.0.2

## References

- [https://github.com/orval-labs/orval/security/advisories/GHSA-h526-wf6g-67jv](https://github.com/orval-labs/orval/security/advisories/GHSA-h526-wf6g-67jv)

## Related threats

- [Orval code injection in x-enum-descriptions via unsanitized JS comments](https://junglewise.ai/threats/cve-2026-25141-orval-code-injection-in-x-enum-descriptions-via-unsanitized-js)
