security-review
PHP security review and vulnerability scanning guide. Use for code review, security audits, and fixing vulnerabilities in PHP applications.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
PHP security review and vulnerability scanning guide. Use for code review, security audits, and fixing vulnerabilities in PHP applications.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Perform Drupal database operations including backups, restores, queries, and migrations. Use for database maintenance, troubleshooting, and data operations.
Guide for building REST APIs, JSON:API endpoints, and external integrations in Drupal.
Guide for Drupal configuration management including Features, config splits, environment handling, and deployment workflows.
Use this skill when running Drush commands, clearing caches, managing configuration, updating databases, or performing any Drupal CLI operations. Trigger phrases include "drush", "clear cache", "cache clear", "config export", "config import", "database update", "feature revert".
Use this skill when implementing Drupal hooks, altering forms, modifying entities, or extending Drupal behavior. Trigger phrases include "hook", "alter", "form alter", "entity presave", "preprocess", "event subscriber".
Guide for Drupal migrations including content imports, data transformations, and migration debugging.
| name | security-review |
| description | PHP security review and vulnerability scanning guide. Use for code review, security audits, and fixing vulnerabilities in PHP applications. |
| allowed-tools | Read, Grep, Glob, Bash |
This skill guides security review and vulnerability scanning for PHP applications.
composer audit # Check known vulnerabilities
composer audit --format=json # JSON output
./vendor/bin/phpstan analyse # PHPStan (if configured)
htmlspecialchars($data, ENT_QUOTES, 'UTF-8')json_encode() for API responsespassword_hash() / password_verify() for passwords.env files not committed to version control.gitignorecomposer audit clean// BAD - Direct concatenation
$query = "SELECT * FROM users WHERE name = '" . $name . "'";
// GOOD - PDO Prepared statements
$stmt = $pdo->prepare("SELECT * FROM users WHERE name = :name");
$stmt->execute(['name' => $name]);
// BAD - Unescaped output
echo $user_input;
// GOOD - Escaped
echo htmlspecialchars($user_input, ENT_QUOTES, 'UTF-8');
// BAD - Direct shell execution
exec("ls " . $user_input);
// GOOD - Escaped argument
exec("ls " . escapeshellarg($user_input));
// Better: Use PHP functions instead of shell commands
// BAD - Direct path from user input
file_get_contents($user_path);
// GOOD - Validate path is within allowed directory
$real_path = realpath($user_path);
// PHP 8.0+: str_starts_with($real_path, $allowed_directory)
// PHP 7.x: strpos($real_path, $allowed_directory) === 0
if ($real_path && str_starts_with($real_path, $allowed_directory)) {
file_get_contents($real_path);
}
// BAD - Unserialize user data
$data = unserialize($user_input);
// GOOD - Use JSON instead
$data = json_decode($user_input, true);
// Or restrict allowed classes
$data = unserialize($input, ['allowed_classes' => [SafeClass::class]]);
When reporting issues, include: