# Privilege Escalation Through Code Logic

> Detects code patterns that allow users to elevate their own privileges through API manipulation or mass assignment.

- Skill: `zakirkun/privilege-escalation-through-code-logic` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zakirkun/privilege-escalation-through-code-logic`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zakirkun/privilege-escalation-through-code-logic/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: zakirkun (https://skillmd.com/u/zakirkun)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/zakirkun/privilege-escalation-through-code-logic

---


# Privilege Escalation Through Code Logic

## Overview
Privilege escalation occurs when users can elevate their own access levels through:
- Mass assignment: User profile update endpoint accepts `role` or `isAdmin` fields
- Parameter tampering: Changing `user_id` to another user's ID
- API parameter forgery: Sending `{"role": "admin"}` in user update request

## Remediation
- Explicitly whitelist allowed fields in user update operations
- Never accept role, permission, or admin fields from user-controlled input
- Verify that any elevation action is performed by a sufficiently privileged user

