Vulnerabilities in pkg:npm/@orpc/zod

PACKAGE
Advisory Identifier: GHSA-gcgf-fh7c-8gf2
Advisory Summary

CVE-2026-103918 is a MODERATE (CVSS 6.5) prototype injection vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting @orpc/zod libraries in the npm ecosystem. The issue involves prototype injection in smart coercion. Remediation is available by upgrading affected packages to version 1.14.10.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/@orpc/zod

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/@orpc/zod. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-gcgf-fh7c-8gf2 CVE-2026-103918 MODERATE @orpc/zod: Prototype injection in smart coercion

CVE-2026-103918 at a Glance

CVE Identifier CVE-2026-103918
GHSA Identifier GHSA-gcgf-fh7c-8gf2
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product @orpc/zod
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality Low (C:L)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-103918

To remediate this vulnerability, upgrade all affected @orpc/zod dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

@orpc/zod fixed: 1.14.10
npm install @orpc/zod@1.14.10
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls @orpc/zod

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-103918, inspect your project dependencies using npm:

npm ls @orpc/zod

Analyze the terminal output to locate any version of @orpc/zod in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.14.10), your application is affected.

Note: The npm ls @orpc/zod command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In @orpc/zod, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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 output result.polluted => true // the attacker object is now this object's prototype ({}).polluted => undefined // Object.prototype is untouched ``` The returned value inherits attacker controlled properties, and any consumer reading them through the prototype chain, such as a handler checking `input.isAdmin`, an `Object.assign` copy, or a config lookup, sees data the client never legitimately supplied. How far that goes depends on what the application does with the coerced input. There is no generic escalation path. This affects the `record` branch of both plugins, and the `object` branch of both plugins for any key that does not first trigger the error below. ### 2. Sub-schemas resolved through the prototype chain The `object` branch looked up sub-schemas with `shape[key]`, which returns inherited members for keys such as `constructor`, `toString` and `__proto__`. Those values, for example the `Object` constructor, were then dereferenced as Zod schemas: ``` schema: z.object({ a: z.number() }) input: { a: '123', constructor: '456' } zod 3 => TypeError: Cannot read properties of undefined (reading 'Symbol(ORPC_CUSTOM_ZOD_DEF)') zod 4 => TypeError: Cannot read properties of undefined (reading 'def') ``` Coercion throws before the assignment, so for object schemas these keys break the request rather than injecting a prototype. Any client can trigger this on its own requests. It does not affect other clients or the process as a whole. ## Impact Any oRPC server that installs `ZodSmartCoercionPlugin` or `experimental_ZodSmartCoercionPlugin` from `@orpc/zod` and has at least one procedure whose input schema contains an object or a record. No authentication or user interaction is required beyond what the procedure itself demands. The effect is scoped to the request that sent the payload. Because no global state is written, one request cannot influence another, and restarting the process is not needed to recover. ## Patch Fixed in 1.14.10. In `packages/zod/src/coercer.ts` and `packages/zod/src/zod4/coercer.ts`: - collect coerced object and record properties into `NullProtoObj`, the null prototype helper already used for untrusted keys in `bracket-notation.ts` and `rpc-matcher.ts`, so `__proto__` stays an ordinary own property and is preserved in the output - guard the shape lookup with `Object.hasOwn`, so unknown keys fall through to `catchall` as they already do for every other name PR: middleapi/orpc#1727 ## Workarounds Reject or strip request payloads containing `__proto__`, `constructor` or `prototype` keys before they reach the handler, or remove the plugin if automatic coercion is not required. Note that `SmartCoercionPlugin` from `@orpc/json-schema`, the recommended replacement for these plugins, was affected by the same class of issue (GHSA-4h5r-cv8j-4456) and is fixed in the same release. ## Credit Reported and fixed internally.

CVE-2026-103918 Affected @orpc/zod Versions

1 component(s)
Fixed Versions:
1.14.10
Product / Package Ecosystem Affected Versions Fixed Version
@orpc/zod
npm
< 1.14.10
1.14.10

References

Frequently Asked Questions

What is CVE-2026-103918?
CVE-2026-103918 is a security vulnerability in @orpc/zod involving Prototype injection in smart coercion under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which @orpc/zod versions are affected?
Affected versions include releases prior to 1.14.10 across affected packages: @orpc/zod.
What version fixes CVE-2026-103918?
Upgrading to 1.14.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @orpc/zod affected?
Yes, @orpc/zod is affected in releases prior to 1.14.10. Upgrade your dependency to 1.14.10 or later.
What is the CVSS score of CVE-2026-103918?
CVE-2026-103918 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-103918?
CVE-2026-103918 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2026-103918?
Run the dependency tree command: 'npm ls @orpc/zod'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gcgf-fh7c-8gf2",
  "modified" : "2026-10-05T17:32:32Z",
  "published" : "2026-10-05T17:32:32Z",
  "aliases" : [ "CVE-2026-103918" ],
  "summary" : "@orpc/zod: Prototype injection in smart coercion",
  "details" : "## Summary\n\n`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:\n\n1. replace the prototype of the coerced input object, and\n2. make a request fail with an unhandled `TypeError` by sending a key such as `constructor`.\n\nThis is the same class of bug as GHSA-4h5r-cv8j-4456 in `@orpc/json-schema`, in a different package.\n\n## This is not global prototype pollution\n\n**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.\n\nWhat 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.\n\n## Details\n\n### 1. `__proto__` replaces the prototype of the coerced value\n\nCoerced 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:\n\n```\nschema: z.record(z.string())\ninput:  {\"a\":\"1\",\"__proto__\":{\"polluted\":true}}\n\nObject.keys(result)  => [\"a\"]      // the __proto__ entry is dropped from the output\nresult.polluted      => true       // the attacker object is now this object's prototype\n({}).polluted        => undefined  // Object.prototype is untouched\n```\n\nThe returned value inherits attacker controlled properties, and any consumer reading them through the prototype chain, such as a handler checking `input.isAdmin`, an `Object.assign` copy, or a config lookup, sees data the client never legitimately supplied. How far that goes depends on what the application does with the coerced input. There is no generic escalation path.\n\nThis affects the `record` branch of both plugins, and the `object` branch of both plugins for any key that does not first trigger the error below.\n\n### 2. Sub-schemas resolved through the prototype chain\n\nThe `object` branch looked up sub-schemas with `shape[key]`, which returns inherited members for keys such as `constructor`, `toString` and `__proto__`. Those values, for example the `Object` constructor, were then dereferenced as Zod schemas:\n\n```\nschema: z.object({ a: z.number() })\ninput:  { a: '123', constructor: '456' }\n\nzod 3 => TypeError: Cannot read properties of undefined (reading 'Symbol(ORPC_CUSTOM_ZOD_DEF)')\nzod 4 => TypeError: Cannot read properties of undefined (reading 'def')\n```\n\nCoercion throws before the assignment, so for object schemas these keys break the request rather than injecting a prototype. Any client can trigger this on its own requests. It does not affect other clients or the process as a whole.\n\n## Impact\n\nAny oRPC server that installs `ZodSmartCoercionPlugin` or `experimental_ZodSmartCoercionPlugin` from `@orpc/zod` and has at least one procedure whose input schema contains an object or a record. No authentication or user interaction is required beyond what the procedure itself demands.\n\nThe effect is scoped to the request that sent the payload. Because no global state is written, one request cannot influence another, and restarting the process is not needed to recover.\n\n## Patch\n\nFixed in 1.14.10.\n\nIn `packages/zod/src/coercer.ts` and `packages/zod/src/zod4/coercer.ts`:\n\n- collect coerced object and record properties into `NullProtoObj`, the null prototype helper already used for untrusted keys in `bracket-notation.ts` and `rpc-matcher.ts`, so `__proto__` stays an ordinary own property and is preserved in the output\n- guard the shape lookup with `Object.hasOwn`, so unknown keys fall through to `catchall` as they already do for every other name\n\nPR: middleapi/orpc#1727\n\n## Workarounds\n\nReject or strip request payloads containing `__proto__`, `constructor` or `prototype` keys before they reach the handler, or remove the plugin if automatic coercion is not required.\n\nNote that `SmartCoercionPlugin` from `@orpc/json-schema`, the recommended replacement for these plugins, was affected by the same class of issue (GHSA-4h5r-cv8j-4456) and is fixed in the same release.\n\n## Credit\n\nReported and fixed internally.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@orpc/zod"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.14.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/middleapi/orpc/security/advisories/GHSA-gcgf-fh7c-8gf2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-103918"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/middleapi/orpc/pull/1727"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/middleapi/orpc/commit/26314dfb443237c495116c5794d3d30a7a22c570"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/middleapi/orpc"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/middleapi/orpc/releases/tag/v1.14.10"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321", "CWE-915" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-05T17:32:32Z",
    "nvd_published_at" : "2026-10-02T20:17:00Z"
  }
}