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.
npx agentmods add rules/atlassian/forge-skills/prototype-pollutiongit clone --depth 1 https://github.com/atlassian/forge-skillsWhat 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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5 | $0.00013 | $0.01044 |
| Opus 5 | $0.00006 | $0.00522 |
| Sonnet 5 | $0.00003 | $0.00209 |
| Haiku 4.5 | $0.00001 | $0.00104 |
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 2d 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.
How it starts
The opening of the file, as written. The whole thing — 147 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,constructorin 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,constructorin 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,constructorkeys 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).
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.
- 2d ago First seen · 147 lines · 13 tokens per session scan A ed7a385f9ddd
prototype-pollution is a cursor rule published in the GitHub repository atlassian/forge-skills (20 stars, last pushed 2d ago), licensed Apache-2.0. It adds 13 tokens to every session and 1,044 once invoked, about $0.0001 per session on Opus 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.
Other cursor rules, from other repositories
project
4DA project rules and conventions.
angular-20
This rule provides comprehensive best practices and coding standards for Angular development, focusing on modern TypeScript, standalone components, signals, and performance optimizations.
dev-standard
Apache Superset development standards and guidelines for Cursor IDE.
typescript
Changes to these high-fan-out internals can affect every message, delta, element, or rerun. Keep work in them minimal, and benchmark changes with representative stress-test apps.
coolify-ai-docs
Master reference to all Coolify AI documentation in .ai/ directory.
python_lib
Tips and guidelines specific to the development of the Streamlit Python library, not applicable to scripts and e2e tests.