# JavaScript Prototype Chain Manipulation

> Detects patterns that allow direct manipulation of the JavaScript prototype chain, enabling prototype pollution and security bypass.

- Skill: `zakirkun/javascript-prototype-chain-manipulation` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zakirkun/javascript-prototype-chain-manipulation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zakirkun/javascript-prototype-chain-manipulation/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Security
- Author: zakirkun (https://skillmd.com/u/zakirkun)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zakirkun/javascript-prototype-chain-manipulation

---


# JavaScript Prototype Chain Manipulation

## Overview
Beyond basic `__proto__` assignment, prototype chain attacks include:
- Setting properties on `Object.prototype` via indirect paths
- Using `constructor.prototype` to poison objects
- `Object.setPrototypeOf()` with attacker-controlled objects
- Vulnerable deserialization that constructs objects on attacker-defined chains

## Remediation
- Freeze base object prototypes in security-sensitive code: `Object.freeze(Object.prototype)`
- Use `Object.create(null)` for pure hash maps
- Validate all keys before property assignment

