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/rce-code-executiongit 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.00012 | $0.01190 |
| Opus 5 | $0.00006 | $0.00595 |
| Sonnet 5 | $0.00002 | $0.00238 |
| Haiku 4.5 | $0.00001 | $0.00119 |
Grade A, and why
rce-code-execution scanned grade A with 1 finding 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 yesterday.
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.
Runs shell commandslowCapability
Expected in a hook, worth knowing in a rule or an instructions file.
- `child_process.exec(command)` How it starts
The opening of the file, as written. The whole thing — 160 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Context
- Forge apps may execute user-provided code via
AsyncFunction,Function(),eval(), or similar constructs. In RuntimeV2, this executes in a shared AWS Lambda context with tenant isolation risks. - Related CWE: CWE-94 (Code Injection), CWE-95 (Eval Injection).
- Past issues: JMCF RCE Investigation - scripted fields executing user code in shared global scope.
- Severity: Critical - enables arbitrary code execution, data exfiltration, tenant data leakage.
Scope & Signals
- Dangerous APIs (same global scope - CRITICAL):
eval(userScript)new Function('param', userScript)new AsyncFunction('param', userScript)(AsyncFunction =async function(){}.constructor)setTimeout(userScript, delay)with string argumentsetInterval(userScript, delay)with string argument
- Somewhat isolated (controlled context):
vm.runInNewContext(script, context)vm.createContext()+vm.runInContext()
- Process isolated (still risky):
child_process.exec(command)child_process.spawn(cmd, args)
Vulnerable Patterns
// CRITICAL - User script in same global scope
const AsyncFunction = async function () {}.constructor;
export async function runUserScript(userScript, issue) {
// User code runs in same scope, can access/modify globals
const f = new AsyncFunction('issue', 'api', userScript);
return await f(issue, api);
}
// CRITICAL - Direct eval
resolver.define('evaluate', async ({ payload }) => {
return eval(payload.expression); // Arbitrary code execution
});
// CRITICAL - Function constructor
const calculate = new Function('x', 'y', payload.formula);
const result = calculate(10, 20);
// HIGH - setTimeout with string (rarely used but dangerous)
setTimeout(payload.callback, 1000); // If callback is a string
Lambda Warm Start Vulnerabilities
In RuntimeV2, AWS Lambda reuses containers across invocations:
// Module-level variables persist across Lambda invocations
let globalCache = {}; // Shared across tenants!
// Malicious user script can:
// 1. Pollute global scope
globalThis.__proto__.malicious = () => { /* exploit */ };
// 2. Modify module-level state
globalCache.otherTenantData = stolenData;
// 3. Override built-in functions
console.error = () => {}; // Suppress security logging
// 4. Access data from previous invocations
const previousData = globalCache.sensitiveData;
Secure Patterns
// BETTER - VM isolation (still same process but isolated context)
const vm = require('vm');
function runUserScript(userScript, context) {
const sandbox = vm.createContext({
issue: context.issue,
api: restrictedApi,
console: safeConsole
});
return vm.runInContext(userScript, sandbox, {
timeout: 5000, // Prevent infinite loops
displayErrors: false
});
}
// BEST - Use Deno subprocesses for true isolation
// Deno provides V8 sandboxing with permission controls
// https://docs.deno.com/runtime/fundamentals/security/
// RECOMMENDED - Use QuickJS for embedded execution
// QuickJS provides true memory and process isolation
import QuickJS from 'quickjs';
const vm = new QuickJS.VM();
const context = vm.createContext({ issue, api });
const result = await vm.evalCode(userScript, context);
Detection Checklist
- Search for
AsyncFunction,new Function(),eval()in codebase. - Trace the script/code argument to untrusted sources.
- Identify module-level variables that could leak between invocations.
- Check for global scope modifications in user-executable code.
- Review caches and state that persist across Lambda warm starts.
Scanning Patterns
// Pattern 1: AsyncFunction constructor
const AsyncFunction = async function () {}.constructor
new AsyncFunction('param1', 'param2', script)
// Pattern 2: Function constructor
new Function('param1', 'param2', script)
// Pattern 3: eval
eval(script)
// Pattern 4: Global state
globalThis.property = value
global.property = value
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.
- yesterday First seen · 160 lines · 12 tokens per session scan A ef4b62890998
rce-code-execution is a cursor rule published in the GitHub repository atlassian/forge-skills (20 stars, last pushed 2d ago), licensed Apache-2.0. It adds 12 tokens to every session and 1,190 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it A with 1 finding (runs shell commands). 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.