# Missing or Incorrect Content-Type Validation

> Detects API endpoints that do not validate or enforce Content-Type headers, enabling MIME-type confusion and CSRF attacks.

- Skill: `zakirkun/missing-or-incorrect-content-type-validation` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add zakirkun/missing-or-incorrect-content-type-validation`
- Raw SKILL.md: https://api.skillmd.com/api/skills/zakirkun/missing-or-incorrect-content-type-validation/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/missing-or-incorrect-content-type-validation

---


# Missing Content-Type Validation

## Overview
APIs that accept requests without validating Content-Type are vulnerable to:
- **CSRF**: Browser forms submit as `application/x-www-form-urlencoded` which HTML forms can send cross-origin
- **Content confusion**: Unexpected parsing if body is mismatched with Content-Type
- **Polyglot attacks**: Content that is valid as multiple types

Modern CSRF protection relies on the browser's cross-origin restriction on JSON Content-Type.

## Remediation
- Validate Content-Type for all POST/PUT/PATCH endpoints
- Reject requests with unexpected Content-Type
- Use CSRF tokens even for JSON APIs as defense-in-depth

