@orval/core is vulnerable to Type Confusion
50
CVE Score
Medium
Type Confusion
Orval's pascal in packages/core/src/utils/case.ts memoizes case conversions in a plain object, pascalMemory, and returns pascalMemory[s] when that lookup is truthy. camel always calls pascal and then decap. Schema names, $ref names, and path parameter names from the OpenAPI document are passed through as that cache key. For toString, valueOf, constructor, hasOwnProperty, isPrototypeOf, toLocaleString, and propertyIsEnumerable, the lookup is the inherited Object.prototype function, so pascal returns that function instead of a string. camel then calls charAt on it and generation throws TypeError: s.charAt is not a function. A direct pascal call stringifies the function into the generated identifier. The fix stores the cache in a Map and reads it with get.
Upgrade the @orval/core package to version 8.25.0 or later.
You are affected if you are using a version that falls within the vulnerable range and generate code from an OpenAPI document that uses an Object.prototype method name, such as constructor or toString, as a schema name, $ref name, or path parameter name.
6.19.0 - 8.24.0
Fixed in 8.25.0@orval/core is vulnerable to Type Confusion in versions 6.19.0 - 8.24.0.
Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.
No credit card required | Scan results in 32 seconds.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.