php-open-redirect-audit

Audit PHP code for open redirect vulnerabilities from user-controlled destinations.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

PHP web applications often perform redirects based on user input or external data. This can enable phishing, OAuth flow hijacking, and session misdirection if the destination is not properly validated.

Core Features & Use Cases

  • Mandatory sink detection: header("Location"), meta refresh, redirect helpers like redirect()/to(), and internal wrappers that output Location.
  • Controllability analysis: trace sources such as $_GET, $_POST, Referer, and return_to; verify allowlists and normalization logic to block unsafe destinations.
  • Output and remediation: generate PoC-style evidence and concrete fixes (restrict to relative paths, enforce server-side allowlists, and normalize schemes).

Quick Start

Run the audit on a PHP codebase to identify user-controlled redirects and output a remediation report.

Frequently Asked Questions about php-open-redirect-audit

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

FAQPage Schema
How do I audit PHP code for open redirect vulnerabilities?

To audit PHP code for open redirect vulnerabilities, trace user-controlled inputs like $_GET and $_POST to redirect sinks such as header("Location") and verify allowlists. This process identifies unsafe destinations and generates remediation reports with concrete fixes.

What is an open redirect vulnerability in PHP web applications?

An open redirect vulnerability in PHP occurs when user-controlled inputs determine redirect destinations without proper validation. This enables phishing, OAuth flow hijacking, and session misdirection if the target URL lacks server-side allowlists or normalization checks.

How do open redirect security audits handle framework redirect helpers?

Open redirect security audits map framework redirect helpers like redirect() and to() as distinct redirect sinks. The audit traces controllability from input sources through internal wrappers that output Location headers across file boundaries to ensure comprehensive vulnerability detection.

Can this audit check PHP redirect normalization logic and allowlists?

Yes, the audit explicitly checks redirect normalization logic and allowlists. It verifies whether server-side allowlists restrict destinations to relative paths and whether scheme normalization effectively blocks unsafe URLs originating from sources like Referer or return_to parameters.

What is the best way to fix user-controlled redirect destinations in PHP?

The best way to fix user-controlled redirect destinations in PHP is to enforce server-side allowlists, restrict redirects to relative paths, and normalize URL schemes. The audit outputs PoC-style evidence alongside these concrete remediation paths.

Does the open redirect audit work across multiple PHP file boundaries?

Yes, the open redirect audit works across multiple PHP file boundaries and framework usage. It performs trace-based evidence gathering, mapping input sources to redirect sinks throughout the entire codebase to identify controllability and validation gaps.