@orpc/json-schema: Prototype injection in smart coercion
What fixes it
- 1.14.9@orpc/json-schema, npmGitHub
npm install @orpc/json-schema@1.14.9
A fixed version on one release line is not the upgrade target for every line. Check your exact version and any vendor backports.
Description
oRPC is a tool that helps build APIs that are end-to-end type-safe and adhere to OpenAPI standards. Prior to 1.14.9, the @orpc/json-schema SmartCoercionPlugin uses JsonSchemaCoercer to collect object properties in a plain object and to resolve schema.properties entries through the prototype chain. A remote client that can reach a procedure with an object input schema can supply __proto__ to replace the prototype of the single coerced request object, or supply Object.prototype member names such as constructor and toString so inherited values are treated as sub-schemas and pass the coercer's satisfaction check. Attacker-controlled inherited properties can consequently affect handler, Object.assign, or configuration lookups, while legitimate __proto__ properties are dropped. The global Object.prototype, unrelated objects, other requests, and other users are not modified, and downstream schema validation still runs. This issue is fixed in version 1.14.9.
Text from CVE List
Affected versions 2
- orpcaffected: < 1.14.9CVE List
- @orpc/json-schema, npm<= 1.14.8GitHub