Skip to content
Heist/ feed
MediumFix available

@orpc/zod: Prototype injection in smart coercion

Type: advisorySource: OSV1 source record

## Summary `ZodSmartCoercionPlugin` and `experimental_ZodSmartCoercionPlugin` mishandle object keys that name `Object.prototype` members. Both coerce request input before validation, so any client that can reach a procedure whose input schema contains an object or a record can: 1. replace the prototype of the coerced input object, and 2. make a request fail with an unhandled `TypeError` by sending a key such as `constructor`. This is the same class of bug as GHSA-4h5r-cv8j-4456 in `@orpc/json-schema`, in a different package. ## This is not global prototype pollution **The global `Object.prototype` is never modified.** No shared or global state is written, so other objects in the process, other requests, and other users are not affected. What changes is the prototype of one object: the value the coercer returns for the request that carried the payload. That object is passed on to validation and to the procedure handler, then discarded when the request ends. An ordinary `{}` created anywhere else in the application is unaffected. ## Details ### 1. `__proto__` replaces the prototype of the coerced value Coerced properties were collected into a plain `{}`, so `newObj['__proto__'] = value` triggers the inherited `__proto__` setter instead of creating an own property. Verified on 1.14.8 against a record schema, in both plugins: ``` schema: z.record(z.string()) input: {"a":"1","__proto__":{"polluted":true}} Object.keys(result) => ["a"] // the __proto__ entry is dropped from the outp

Announced Group revision 1
Original source ↗

GHSA-gcgf-fh7c-8gf2

Primary source · Revision 1

Imported from structured advisory data. Source references identify upstream records or fields; verify affected versions and your deployed configuration.

Security context

Source reference: osv:GHSA-gcgf-fh7c-8gf2

@orpc/zod

Source reference: /affected/0/package/name

Affected versions
Not stated in this record
Fixed versions
1.14.10

Source reference: /affected/0/ranges

Prerequisites
Not stated in this record

Structured affected-version data

Original package identities and version rules from this source.

[
  {
    "ranges": [
      {
        "type": "SEMVER",
        "events": [
          {
            "introduced": "0"
          },
          {
            "fixed": "1.14.10"
          }
        ]
      }
    ],
    "package": {
      "name": "@orpc/zod",
      "purl": "pkg:npm/%40orpc/zod",
      "ecosystem": "npm"
    },
    "database_specific": {
      "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-gcgf-fh7c-8gf2/GHSA-gcgf-fh7c-8gf2.json"
    }
  }
]
Related CVEs
CVE-2026-103918

Source reference: /aliases

Publisher severity

medium

Source reference: /severity/0/score

Linked CVE context

These ratings describe the referenced vulnerabilities and products. They are not a severity rating for every application using this dependency.

Event
#84433 · Revision 1
Added to Heist Feed
Publisher date
Read the original announcement