Orval npm Package Vulnerability: Import-Time RCE via Schema Property Injection
- Severity
- HIGH
- Affected component
- orval (npm)
- Affected versions
- < 8.21.0 or < 8.22.0 or < 8.21.0
- Patched version
- Not yet available
The orval npm package is reportedly vulnerable to import-time remote code execution due to schema property name injection. This issue is under investigation.
What happened
The vulnerability in orval allows for import-time remote code execution via schema property name injection. This occurs when generating a zod object without escaping double quotes in property names. The affected versions are those below 8.21.0, 8.22.0, and 8.21.0. The issue has been flagged but not yet confirmed as exploited in the wild.
To assess your exposure, check if your project uses orval and if so, which version. If you are using a version below the specified thresholds, you may be at risk. It is recommended to avoid using orval until a patched version is released or to ensure that schema property names do not contain double quotes if continued use is necessary.
What to do about it
- Avoid using orval until a patched version is released.
- If using orval, ensure that schema property names do not contain double quotes.
- Monitor the primary sources for updates on patched versions and further details.
- Consult the primary sources for the most current information on affected versions and recommended actions.
How 0Day would have caught this
orval 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.
Frequently asked questions
Am I affected?
You may be affected if you are using orval npm package versions below 8.21.0, 8.22.0, or 8.21.0.
What should I do right now?
Avoid using orval until a patched version is released. If you must use orval, ensure that schema property names do not contain double quotes.
Is there an official fix available?
No official fix has been published yet. Monitor the primary sources for updates.
Sources
- [GHSA-2h9g-j24r-h63g] Orval: Import-time RCE via array-items default -> zod module-level template literal
- [GHSA-2w86-xfrc-g85r] Orval: RCE via schema property name -> computed-property-key injection in the MSW mock generator
- [GHSA-3575-w9fc-c2j6] Orval: Import-time RCE via enum-typed default -> zod module-level template literal
- [GHSA-6437-gxhq-pqv8] Orval: Import-time RCE via header parameter name -> computed-property-key injection in the zod client
- [GHSA-653q-5476-x79g] Orval: Import-time RCE via query parameter name -> computed-property-key injection in the zod cli
- [GHSA-6mr6-jvcr-2f25] Orval: Import-time RCE via schema property name -> computed-property-key injection in the zod client
- [GHSA-88f2-fpv8-89q2] Orval: RCE via servers[].url -> unescaped request-URL template literal (with getBaseUrlFromSpecification)
- [GHSA-8j6p-r8jg-mxqh] Orval: Import-time RCE via header-parameter default -> zod module-level template literal