<!-- Copyright (c) 2026 defconxt. All rights reserved. -->
<!-- Licensed under AGPL-3.0 — see LICENSE file for details. -->
<!-- NERF is a trademark of defconxt. -->
---
name: detecting-prototype-pollution
description: >-
  Detect and exploit prototype pollution vulnerabilities in JavaScript applications by identifying gadgets that allow property injection on Object.prototype for XSS or RCE.
domain: cybersecurity
subdomain: browser-security
tags:
  - prototype-pollution
  - javascript
  - gadget
  - property-injection
version: "1.0"
author: defconxt
license: AGPL-3.0
metadata:
  mitre-attack: ["T1059.007"]
  frameworks: ["MITRE ATT&CK", "OWASP"]
  tools: ["burpsuite", "semgrep", "ppmap"]
---

# Detecting Prototype Pollution

## Overview

Detect and exploit prototype pollution vulnerabilities in JavaScript applications by identifying gadgets that allow property injection on Object.prototype for XSS or RCE.

## Prerequisites

| Tool / Requirement | Details |
|---|---|
| `burpsuite` | Security tooling |
| `semgrep` | Security tooling |
| `ppmap` | Security tooling |
| Burp Suite, semgrep, ppmap scanner, target JavaScript application | Environment requirement |

## Quick Reference

```bash
# Quick start commands
node scripts/agent.js --help
semgrep --config p/javascript-prototype-pollution ./src
```

## Workflow

### Step 1: Scan for Pollution Sinks

```bash
semgrep --config p/javascript-prototype-pollution ./src
```

### Step 2: Test with ppmap

```bash
node scripts/agent.js scan --url https://target.com
```

### Step 3: Identify Gadgets

```bash
node scripts/agent.js gadgets --url https://target.com --library lodash
```

## Detection

```yaml
title: Prototype Pollution Detection
id: 8e087301-bd17-4ffd-a454-939dab4440a1
status: experimental
description: Detects suspicious activity related to detecting prototype pollution techniques in browser security context
logsource:
  category: proxy
  product: windows
detection:
  selection:
    cs_uri_query: "*script*"
  condition: selection
level: medium
tags:
  - attack.t1059.007
  - attack.initial_access
falsepositives:
  - Browser security extensions performing routine URL reputation checks
```


**Detection Opportunities**

| Indicator | Source | Detection Logic |
|---|---|---|
| Prototype Pollution Detection | windows/proxy | Sigma rule (medium) |
| ATT&CK Coverage | MITRE ATT&CK | T1059.007 |

## Verification

- **Verify scan results**: `node scripts/agent.js scan --url https://target.com`
- **Confirm exploitability**: `node scripts/agent.js exploit --url https://target.com`

## References

- MITRE ATT&CK: T1059.007
- Frameworks: MITRE ATT&CK, OWASP
- Tools: burpsuite, semgrep, ppmap
