/engineering:web-app-security-auditfrom engineering
Audits PHP/JavaScript/HTML web apps across config, auth, authorization, input validation, XSS, API, headers, and dependencies with severity-rated findings.
Ships in engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Acknowledgement: Shared by Peter Bamuhigire, techguypeter.com, +256 784 464178.
references only as needed.SKILL.md, then load only the referenced deep-dive files needed for the task.Skill-specific anti-patterns:
| Category | Artifact | Format | Example |
|---|---|---|---|
| Security | Web application audit report | Markdown doc covering config, auth, input validation, and session handling findings | docs/security/web-audit-2026-04-16.md |
| Security | Remediation plan | Markdown doc listing findings, owners, and due dates | docs/security/web-remediation-2026-04-16.md |
references/ directory for deep detail after reading the core workflow below.Systematic security audit for PHP/JavaScript/HTML web applications. Scans 8 security layers, produces a structured report with severity-rated findings and actionable fix recommendations that Codex can apply.
Core Principle: Scan everything before fixing anything. Full picture first, then targeted remediation.
Scope: Web application code only (PHP, JS, HTML, CSS). For Android security and database security, use dedicated skills.
Cross-references: php-security (PHP patterns), vibe-security-skill (OWASP, auth), api-error-handling (API errors)
See references/ for: audit-checklist-detailed.md, security-headers-reference.md, report-template.md
1. App structure: entry points (public/*.php, api/*.php), config (.env, config/, php.ini, .htaccess), routes, middleware.
2. Auth flows: login/logout/register, sessions (session_start, JWT), password handling.
3. Data flows: DB queries (PDO, mysqli), external APIs (curl), uploads, output points (echo, templates).
Use parallel subagents for independent layers. Each layer produces findings with severity.
Layer execution order:
Generate docs/security-audit/YYYY-MM-DD-audit.md using the report template.
| Severity | Criteria | Example |
|---|---|---|
| CRITICAL | Exploitable now, data breach risk | SQL injection, hardcoded credentials, no auth on admin |
| HIGH | Exploitable with effort, significant impact | Missing session regeneration, weak password hashing |
| MEDIUM | Requires specific conditions to exploit | Missing CSRF on non-critical form, verbose errors |
| LOW | Minor security weakness, defense-in-depth | Missing security header, loose CORS |
| INFO | Best practice recommendation | Missing SRI on CDN, could add rate limiting |
Scan targets: php.ini, .env, .htaccess, config files, deployment configs
Critical checks:
Grep patterns:
display_errors\s*=\s*(On|1|true) → CRITICAL: errors shown to users
expose_php\s*=\s*(On|1|true) → MEDIUM: PHP version disclosed
allow_url_include\s*=\s*(On|1|true) → CRITICAL: remote file inclusion
File checks:
.env in webroot → CRITICAL: secrets accessible
.env in .gitignore → Check: must be ignored
phpinfo() calls → HIGH: full config exposed
Secret patterns:
password\s*=\s*['"][^'"]+['"] → HIGH: hardcoded password
(api_key|secret|token)\s*= → HIGH: check if in env or hardcoded
DB_(PASSWORD|HOST|USER) → Verify: in .env, not in code
Fix reference: php-security > php.ini Security Hardening, Error Handling
Scan targets: Login/logout handlers, session configuration, password code
Critical checks:
Session security:
session.use_strict_mode → Must be 1
session.cookie_httponly → Must be 1
session.use_only_cookies → Must be 1
session_regenerate_id after login → CRITICAL if missing
Password handling:
password_hash with PASSWORD_ARGON2ID → Required
password_verify usage → Required (not manual comparison)
md5() or sha1() for passwords → CRITICAL: weak hashing
Auth flow:
Login rate limiting → HIGH if missing
Account lockout mechanism → MEDIUM if missing
Session timeout enforcement → HIGH if missing
Complete session destruction on logout → MEDIUM if missing
Cryptographic practices:
openssl_encrypt/decrypt usage → MEDIUM: prefer Libsodium (sodium_*)
Custom encryption (XOR, base64 "encryption") → CRITICAL: not encryption
Hardcoded encryption keys in source → CRITICAL: use env/vault
random_int/random_bytes for tokens → Required (not rand/mt_rand)
Fix reference: php-security > Session Security, Cryptographic Best Practices, dual-auth-rbac > Password Security
Scan targets: Middleware, route guards, database queries, API endpoints
Critical checks:
IDOR (Insecure Direct Object Reference):
Endpoints using $_GET['id'] without ownership check → CRITICAL
Queries without WHERE franchise_id = ? → CRITICAL (multi-tenant)
Sequential IDs exposed in URLs → MEDIUM
RBAC:
Permission checks on protected routes → HIGH if missing
Super admin bypass properly implemented → Check
Cross-tenant data access prevention → CRITICAL if missing
Route protection:
Admin routes without auth middleware → CRITICAL
API endpoints without authentication → HIGH (if should be protected)
File access without authorization → HIGH
Fix reference: vibe-security-skill > A01 Broken Access Control, dual-auth-rbac > RBAC
Scan targets: All form handlers, API endpoints, file upload handlers
Critical checks:
Raw input usage:
$_GET[ without filter_var/validation → HIGH
$_POST[ without filter_var/validation → HIGH
$_REQUEST[ usage → MEDIUM (ambiguous source)
SQL injection:
String concatenation in SQL queries → CRITICAL
"SELECT.*\$_" pattern → CRITICAL
"WHERE.*\$_" pattern → CRITICAL
Non-parameterized queries → CRITICAL
File uploads:
No MIME type validation (finfo) → HIGH
No file size limit → MEDIUM
Files stored in webroot → HIGH
Original filename used for storage → MEDIUM
Type validation:
Integer inputs not validated → MEDIUM
Email inputs not validated → LOW
Enum values not whitelisted → MEDIUM
PHP-specific vulnerabilities:
== instead of === (type juggling) → HIGH: "0e123"=="0e456" is true
in_array() without strict 3rd param → MEDIUM: type coercion
unserialize() on user/external data → CRITICAL: object injection/RCE
eval() with any variable input → CRITICAL: code execution
exec/system/shell_exec/passthru → CRITICAL: command injection
preg_replace with /e modifier → CRITICAL: code execution (PHP <7)
include/require with user-controlled path → CRITICAL: file inclusion
missing declare(strict_types=1) → LOW: type safety gap
Fix reference: php-security > Input Validation, SQL Injection Prevention, File Upload Security, PHP-Specific Vulnerabilities
Scan targets: All output points (echo, print, templates), JavaScript embedding
Critical checks:
XSS vulnerabilities:
echo $_GET or echo $_POST → CRITICAL
echo $variable without htmlspecialchars → HIGH (if user-sourced)
printf with %s from user input → HIGH
Template encoding:
Missing ENT_QUOTES in htmlspecialchars → MEDIUM
Missing UTF-8 charset parameter → LOW
Raw output in JavaScript context → HIGH
Content Security Policy:
No CSP header set → MEDIUM
CSP with 'unsafe-inline' → MEDIUM
CSP with 'unsafe-eval' → HIGH
No script-src directive → MEDIUM
Fix reference: php-security > Output Encoding, XSS Prevention
Scan targets: REST API endpoints, AJAX handlers, form actions
Critical checks:
CSRF protection:
State-changing endpoints without CSRF token → HIGH
CSRF token not validated server-side → CRITICAL
Missing SameSite cookie attribute → MEDIUM
Rate limiting:
Login endpoint without rate limiting → HIGH
API endpoints without throttling → MEDIUM
Password reset without rate limiting → HIGH
Error disclosure:
Stack traces in API responses → HIGH
Database error messages exposed → CRITICAL
Internal file paths in errors → MEDIUM
CORS:
Access-Control-Allow-Origin: * → HIGH
Credentials with wildcard origin → CRITICAL
Missing CORS headers (if API) → INFO
Webhook security:
Webhook endpoints without signature verify → CRITICAL
No idempotency handling → MEDIUM
Fix reference: php-security > CSRF Protection, api-error-handling, vibe-security-skill > A02
Scan targets: Response headers on all major endpoints
Required headers checklist:
Strict-Transport-Security: max-age=31536000; includeSubDomains → HIGH if missing
Content-Security-Policy: [see CSP section] → MEDIUM if missing
X-Content-Type-Options: nosniff → LOW if missing
X-Frame-Options: DENY (or SAMEORIGIN) → MEDIUM if missing
Referrer-Policy: strict-origin-when-cross-origin → LOW if missing
Cache-Control: no-store (on sensitive pages) → MEDIUM if missing
X-Powered-By: removed → LOW if present
Server: version removed → LOW if present
Fix reference: See references/security-headers-reference.md
Scan targets: composer.json, composer.lock, package.json, CDN scripts
Critical checks:
PHP dependencies:
composer audit output → Severity from advisory
Outdated packages (major versions) → MEDIUM
composer.lock committed → HIGH if missing
JavaScript:
npm audit / yarn audit output → Severity from advisory
CDN scripts without SRI integrity attr → MEDIUM
Inline scripts from external sources → HIGH
General:
.env.example with real values → HIGH
Credentials in package configs → CRITICAL
Lock files in .gitignore → HIGH (should be committed)
Fix reference: vibe-security-skill > A03 Supply Chain
Agent: Explore the codebase to identify:
- All PHP entry points (public/, api/, *.php in webroot)
- Configuration files (.env, config/, php.ini, .htaccess)
- Authentication code (login, session, JWT)
- Database query patterns (PDO, mysqli)
- Template/output files
- API endpoint definitions
- JavaScript files and CDN references
Return a structured map of the application.
Batch 1 (independent):
- Agent: Scan Layer 1 (Configuration)
- Agent: Scan Layer 7 (HTTP Headers)
- Agent: Scan Layer 8 (Dependencies)
Batch 2 (auth-dependent):
- Agent: Scan Layer 2 (Auth & Sessions)
- Agent: Scan Layer 3 (Authorization)
Batch 3 (data-flow):
- Agent: Scan Layer 4 (Input Validation)
- Agent: Scan Layer 5 (Output & XSS)
- Agent: Scan Layer 6 (API Security)
Aggregate all findings into docs/security-audit/YYYY-MM-DD-audit.md using the report template. Sort by severity.
For each layer, use this prompt structure:
You are auditing a web application for security vulnerabilities.
LAYER: [Layer Name]
SCOPE: [Files/patterns to scan]
For each finding, report:
- Severity: CRITICAL|HIGH|MEDIUM|LOW|INFO
- Location: file_path:line_number
- Finding: What the vulnerability is
- Impact: What an attacker could do
- Fix: Specific code change needed
- Reference: Which skill has the fix pattern
Scan these patterns:
[Layer-specific grep patterns]
Return findings as a structured list sorted by severity.
The auditor is reviewing controls, not building them. Build/operate detail (UFW commands, iptables rate-limit, ModSecurity install, WireGuard setup, TLS lifecycle) lives in references/network-security-layer.md. Audit-focused detail with checklist and severities lives in references/network-security-audit.md.
Stack assumption: Debian/Ubuntu VPS, self-host preferred (Nginx + ModSecurity or Coraza + OWASP CRS), Vault for secrets and PKI, optional managed WAF (Cloudflare, AWS WAF). Out of scope: service mesh, DDoS deep-dive beyond WAF rate-limit basics.
Inbound default policy not DROP/deny → CRITICAL
SSH exposed without rate-limit → HIGH
Database/admin ports public (not VPN-only or lo) → CRITICAL
No egress allow-list → MEDIUM (HIGH for regulated)
Live rules drift from declared rules in source ctrl → HIGH
Tool choice: ufw for simple single-host, nftables for new deployments, iptables only on legacy. Egress allow-list: mirrors, DNS, NTP, egress proxy or API gateway, metrics. Deny everything else to contain lateral movement.
No WAF in blocking mode at edge or reverse proxy → HIGH
CRS version not pinned, no upgrade cadence → MEDIUM
Blanket disables of whole rule categories → HIGH (need compensating control)
False-positive log not reviewed in last 30 days → MEDIUM
No rate-limit on auth and password-reset endpoints → HIGH
Managed (AWS WAF, Cloudflare) vs self-hosted (ModSecurity or Coraza + OWASP CRS) matrix in the reference. CRS tuning: paranoia level 1 in detection-only, replay traffic, write targeted exclusions per URI/parameter (never blanket disables), promote to blocking once false positives are under threshold, re-tune each CRS release. Prefer Coraza for new self-hosted deployments; ModSecurity v3 still supported on existing Nginx.
Internal service-to-service traffic in plaintext → HIGH
Long-lived service credentials in env files → HIGH
Internal apps reachable on LAN with no identity check → CRITICAL
"VPN means trusted" assumption documented anywhere → HIGH
No device-posture signal in IdP → MEDIUM
Core idea (NIST SP 800-207, August 2020): no implicit trust based on physical or network location, or asset ownership; authn and authz are discrete functions performed before every session. Concrete controls: mTLS service-to-service, identity-aware proxies (Cloudflare Access, Pomerium, Tailscale serve), short-lived workload identities via SPIFFE/SPIRE, WireGuard for the management plane. Seven foundational tenets are in §2.1 of the PDF; quote directly when writing findings.
Static long-lived WireGuard peer keys, no rotation → HIGH
No mapping from peer key to human identity → HIGH
Shared admin VPN key used by multiple operators → CRITICAL
SSH password auth still permitted on bastion → HIGH
Bastion without session recording → MEDIUM
VPN audit log retention < 1 year (or contractual) → MEDIUM/HIGH
WireGuard is the recommended default. Key distribution is explicitly out of scope of WireGuard itself — solve via Vault PKI (short-lived peer keys) or Ansible (rotated [Peer] blocks). Every session must map to a human identity, via an identity-aware proxy or by correlating handshake events with the IdP in the SIEM.
Verify, with evidence: default-deny inbound on every public host (rule export attached); egress filter present with allow-list in source control; WAF in blocking mode at edge OR ModSecurity/Coraza + CRS at reverse proxy with CRS pinned and upgrade cadence documented; WAF false-positive log reviewed in last 30 days; mTLS between any two services crossing a host boundary OR explicit accepted-risk record; all ops access via identity-aware proxy or session-logged bastion; WireGuard peer keys rotate at least quarterly OR are short-lived from PKI; VPN audit log retention at least one year (or contractual minimum). Full reference, severity rubric, and citations: references/network-security-audit.md.
When user invokes this skill:
Fallback without execution or a runnable environment: complete static review, mark dynamic checks unverified, and provide exact reproduction steps.
| Finding | Release decision | Evidence required |
|---|---|---|
| Auth bypass, injection, cross-tenant access, secret, or exploitable XSS | block | Reproduction and passing remediation test |
| High-risk dependency or configuration exposure | block or documented exception | Version/configuration proof |
| Defence-in-depth gap without exploit path | conditional | Owner and remediation date |
references/access-control-flaws.md (opens in a new tab)references/audit-checklist-detailed.md (opens in a new tab)references/auth-session-flaws.md (opens in a new tab)references/business-logic-flaws.md (opens in a new tab)references/input-validation-patterns.md (opens in a new tab)references/network-security-audit.md (opens in a new tab)references/network-security-layer.md (opens in a new tab)references/report-template.md (opens in a new tab)references/security-headers-reference.md (opens in a new tab)references/wahh-attack-patterns.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub peterbamuhigire/chwezi-dev-engine --plugin engineering169 skills in this plugin
/accounting-engineUse when designing or implementing double-entry accounting policy and an embedded ledger engine for invoices, payments, stock, balanced postings, mapped accounts, idempotency, reversals, period locks, audit trails, and financial statements./accounting-finance-controllerUse when coordinating accounting and finance implementation reviews, doctrine routing, control evidence, remediation priorities, and release decisions across a software system./advanced-testing-strategyUse when designing or reviewing test strategy for production systems, APIs, mobile apps, SaaS platforms, ERP workflows, and AI-enabled systems. Covers unit, integration, contract, end-to-end, regression, release-gate, and risk-based testing decisions.Other plugins' skills for the same job