prototype-pollution

prototype-pollution is a cursor rule for Cursor from atlassian/forge-skills. It costs 13 tokens per session (1,157 once invoked), scanned A, original, Apache-2.0.

A set of review rules for finding prototype pollution vulnerabilities in Atlassian Forge apps. Prototype pollution is when untrusted input changes shared JavaScript object behavior.

In plain words
What is it for?
Use it to review JSON parsing, object merging, query and body parsing, deserialization, and object assignments for unsafe keys such as __proto__, prototype, and constructor.
Why use it?
It helps catch bugs that can leak data between customers or raise a user's permissions from asUser to asApp.

Cursor rule for Cursor ✓ vendor

Written for Cursor: a Cursor rule (.mdc).

Good fit Use it to review JSON parsing, object merging, query and body parsing, deserialization, and object assignments for unsafe keys such as proto, prototype, and constructor.

Compare 6 cursor rules from other repositories ↓
Install with agentmods
npx agentmods add rules/atlassian/forge-skills/prototype-pollution
About the project

Atlassian Forge Skills supports Atlassian Forge, a platform for building and deploying apps that extend products such as Jira and Confluence. Its skills and MCP-backed tools help coding agents create Forge apps, review them before deployment, optimize usage, troubleshoot failures, and work with Forge APIs and the Atlassian Design System.

atlassian/forge-skills · 35 stars · on GitHub · developer.atlassian.com

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Clone the repo
git clone --depth 1 https://github.com/atlassian/forge-skills

Made for: Cursor.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for prototype-pollution

README.md
[![agentmods](https://agentmods.dev/badge/rules/atlassian/forge-skills/prototype-pollution/github.svg)](https://agentmods.dev/rules/atlassian/forge-skills/prototype-pollution)
Your own site
<a href="https://agentmods.dev/rules/atlassian/forge-skills/prototype-pollution"><img src="https://agentmods.dev/badge/rules/atlassian/forge-skills/prototype-pollution/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for prototype-pollution

Your own site · 80×15
<a href="https://agentmods.dev/rules/atlassian/forge-skills/prototype-pollution"><img src="https://agentmods.dev/badge/rules/atlassian/forge-skills/prototype-pollution.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 13 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,157 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00013 $0.01157
Opus 5.5 $0.00005 $0.00463
Sonnet 5.5 $0.00003 $0.00231
Haiku 4.5 $0.00001 $0.00116

Measured 20d ago against content hash beb0f67ef87e, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

prototype-pollution scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 20d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

skills/forge-security-review/assets/security-rules/forge-injection/prototype-pollution.mdc · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Context

  • Prototype pollution in Forge RuntimeV2 can enable cross tenant data leakage and privilege escalation from asUser to asApp by injecting fetch headers.
  • Related CWE: CWE-1321 (Improperly Controlled Modification of Object Prototype Attributes).
  • Forge-specific: Default libraries in RuntimeV2 allow attackers to exploit prototype pollution for privilege escalation.

Scope & Signals

  • Sources: JSON parsing, object merging, query/body parsing, deserialization.
  • Sinks: Object property assignment, deep merge utilities, spread operators with untrusted keys.
  • Red flags:
    • __proto__, prototype, constructor in property paths from user input.
    • Deep merge without prototype guards (lodash < 4.17.12, jQuery.extend, etc.).
    • Object.assign with untrusted objects.

Forge-Specific Escalation Path

// In RuntimeV2, prototype pollution can upgrade asUser() to asApp()
// by injecting headers into fetch calls

// If attacker can pollute Object.prototype:
Object.prototype.headers = {
  'x-forge-oauth': 'app'  // Hypothetical escalation header
};

// Subsequent asUser() calls may inherit polluted headers
const api = asUser();
await api.requestJira(route`/rest/api/3/issue/TEST-1`);
// Request now uses app-level permissions

Vulnerable Patterns

// VULNERABLE - Merge user input without guards
const config = {};
Object.assign(config, JSON.parse(payload.settings));

// VULNERABLE - Deep merge with untrusted data
import merge from 'lodash.merge';
const merged = merge(defaults, userInput);

// VULNERABLE - Bracket notation with user key
const key = payload.key;
obj[key] = payload.value;  // key could be "__proto__"

// VULNERABLE - Recursive object assignment
function deepSet(obj, path, value) {
  const keys = path.split('.');
  let current = obj;
  for (let i = 0; i < keys.length - 1; i++) {
    current = current[keys[i]] = current[keys[i]] || {};
  }
  current[keys[keys.length - 1]] = value;
}
deepSet({}, payload.path, payload.value);  // path = "__proto__.polluted"

Secure Patterns

// SECURE - Reject dangerous keys
function safeSet(obj, key, value) {
  if (['__proto__', 'prototype', 'constructor'].includes(key)) {
    throw new Error('Invalid key');
  }
  obj[key] = value;
}

// SECURE - Use Object.create(null) for prototype-less objects
const config = Object.create(null);
Object.assign(config, sanitizedInput);

// SECURE - Use Map instead of objects for dynamic keys
const userSettings = new Map();
userSettings.set(payload.key, payload.value);

// SECURE - Schema validation with allowlisted keys
import { z } from 'zod';
const SettingsSchema = z.object({
  theme: z.string(),
  language: z.string()
}).strict();  // Reject unknown keys

const settings = SettingsSchema.parse(payload.settings);

// SECURE - Updated lodash with prototype guards
import merge from 'lodash.merge';  // v4.17.21+
// Still recommend explicit key validation

Detection Checklist

  • Search for __proto__, prototype, constructor in code.
  • Find Object.assign, spread operators with untrusted sources.
  • Check for deep merge utilities and their versions.
  • Identify bracket notation property access with dynamic keys.
  • Look for recursive object traversal/assignment functions.
  • Check package.json for vulnerable lodash, hoek, jQuery versions.

PoC / Test Leads

// Test payload for prototype pollution
const maliciousPayload = {
  "__proto__": {
    "polluted": true
  }
};

// Or via constructor
const payload2 = {
  "constructor": {
    "prototype": {
      "polluted": true
    }
  }
};

// Verify pollution
console.log({}.polluted);  // Should be undefined, true if polluted

Remediation Guidance (advisory)

  • Reject __proto__, prototype, constructor keys at input validation.
  • Use schema validators (zod, joi) with strict mode to allowlist keys.
  • Create objects with Object.create(null) when prototype not needed.
  • Use Map/Set for dynamic key storage.
  • Update lodash to 4.17.21+ and other merge libraries.
  • Freeze prototypes in sensitive contexts: Object.freeze(Object.prototype).

Read the full file on GitHub · 151 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 20d ago Changed · +4 lines beb0f67ef87e
  2. 3mo ago First seen · 147 lines · 13 tokens per session scan A ed7a385f9ddd

Subscribe to this mod's changes

prototype-pollution is a cursor rule published in the GitHub repository atlassian/forge-skills (35 stars, last pushed 4d ago), licensed Apache-2.0. It adds 13 tokens to every session and 1,157 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

prototype-pollution compared with cursor rules from other repositories

prototype-pollution next to 6 cursor rules from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
prototype-pollutionatlassian/forge-skillsCursor rule354d agoApache-2.0A13Cursor
ponytailDietrichGebert/ponytailCursor rule201k8d agoMITA604Cursor
angular-20angular/angularCursor rule102k4d agoMITA0Cursor
dev-standardapache/supersetCursor rule76ktodayApache-2.0A1,147Cursor
prefer-assertions-over-defensive-checksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
prefer-direct-imports-over-module-mocksprisma/ormCursor rule48ktodayApache-2.0A0Cursor
shared-plane-packagesprisma/ormCursor rule48ktodayApache-2.0A0Cursor