php-cmd-audit

Trace PHP data flows from user input to command execution sinks.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

本技能帮助开发团队快速识别并修复 PHP Web 应用源码中的命令执行风险,通过跟踪输入到命令拼接的路径,确保不存在未经过滤的用户输入进入系统命令的情况。

Core Features & Use Cases

  • 自动检测命令执行相关的 Sink(如 exec、system、shell_exec 等)及类似模式。
  • 跟踪输入到命令构造点的数据流链,结合证据链与可观测证据评估可利用性。
  • 提供可复现的 PoC 模板与修复建议,帮助开发与安全审计团队快速定位并修复风险点。
  • 适用场景:在 PHP Web 应用的代码审计、上线前安全评估、回归验证等场景中,对疑似命令注入点进行全链路验证。

Quick Start

在代码库中执行静态分析,识别命令拼接点并输出数据流证据报告。

Frequently Asked Questions about php-cmd-audit

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

FAQPage Schema
How do I detect command injection vulnerabilities in PHP source code?

To detect PHP command injection vulnerabilities, trace user input data flow paths to command execution sinks like exec, system, and shell_exec. This analysis enforces an end-to-end evidence chain per sink to validate exploitability and provides remediation guidance.

How does static analysis trace user input to command execution sinks in PHP?

Static analysis traces user input to command execution sinks by mapping end-to-end data-flow paths from input sources to system calls. It enforces a data-flow evidence chain per sink to verify if unfiltered user input reaches command construction points.

Can I use static analysis for PHP security audits before deployment?

Yes, you can apply static analysis for PHP security audits before deployment. It validates suspected command injection points by tracing data flow from inputs to system calls, outputting reproducible PoC templates and fix recommendations for regression verification.

What is the best way to find unfiltered user input in PHP system calls?

The best way to find unfiltered user input in PHP system calls is applying end-to-end data-flow tracing. This validates exploitability by enforcing a data-flow evidence chain per sink and checking the Sink Evidence Type Checklist against route tracing outputs.

Why does my PHP static analysis report false positives for command injection?

False positives for command injection often occur when analysis lacks end-to-end data-flow evidence. Enforcing a data-flow evidence chain per sink and requiring PoC templates ensures only exploitable paths where unfiltered input enters system calls are reported.

Do I need route tracing outputs to audit PHP command injection risks?

Yes, you need route tracing outputs to effectively audit PHP command injection risks. The analysis relies on php-route-tracer outputs to map input sources and validate the end-to-end data-flow chain leading to command execution sinks.