php-csrf-audit

Analyze PHP source code to verify CSRF protections on state-changing endpoints.

386|38|Updated Mar 24, 2026
One-click install
npx skills add https://github.com/0xShe/PHP-Code-Audit-Skill --skill php-csrf-audit-0xshe
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: php-csrf-audit
Source: https://github.com/0xShe/PHP-Code-Audit-Skill/tree/main/php-csrf-audit
Command: npx skills add https://github.com/0xShe/PHP-Code-Audit-Skill --skill php-csrf-audit-0xshe

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill analyzes PHP project source code to identify state-changing interfaces and verify whether CSRF protections—such as token generation/validation, SameSite, and CORS configurations—are correctly implemented.

Core Features & Use Cases

  • Detects state-changing entry points (POST/PUT/PATCH/DELETE, or other endpoints with side effects)
  • Traces CSRF token generation and validation flows, and checks for bypass conditions
  • Produces structured reports with severity ratings, PoC guidance, and remediation recommendations

Quick Start

Run the CSRF audit against your PHP project and review the generated reports to identify unprotected endpoints.

Frequently Asked Questions about php-csrf-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I audit CSRF protections in a PHP application?

To audit CSRF protections in a PHP application, analyze the source code to detect state-changing endpoints like POST, PUT, PATCH, and DELETE, then trace token generation and validation flows to identify bypass conditions.

What does a CSRF token validation check look for in PHP code review?

A CSRF token validation check in PHP code review traces token generation and validation flows, verifies SameSite and CORS configurations, identifies bypass conditions on side-effecting endpoints, and outputs structured reports with severity ratings and remediation guidance.

Can I check for CSRF vulnerabilities on GET requests in PHP web projects?

Yes, you can check for CSRF vulnerabilities on GET requests in PHP web projects by analyzing source code to identify potentially side-effecting GET endpoints and verifying whether proper token validation and SameSite protections are implemented.

Does this CSRF audit cover SameSite and CORS configurations?

Yes, this CSRF audit covers SameSite and CORS configurations by analyzing PHP source code to ensure these protections are correctly implemented alongside token generation and validation traces for state-changing endpoints.

What is the best way to identify unprotected state-changing endpoints in PHP?

The best way to identify unprotected state-changing endpoints in PHP is to analyze the source code for POST, PUT, PATCH, and DELETE methods, checking for missing CSRF token validation and producing structured reports with severity ratings and remediation recommendations.

Why does my PHP application fail a security audit for CSRF bypass conditions?

Your PHP application fails a security audit for CSRF bypass conditions when source code analysis reveals incomplete token validation flows or improper SameSite and CORS configurations on state-changing endpoints, requiring remediation to secure the application.