Back to Auditor

How the Auditor Works

Step-by-step, no marketing. Including what it cannot do.

Read-Only Static Analysis Nothing Stored

01The pieces (4 files)

The whole module is four files. Nothing hidden, nothing compiled:

02Your steps in the UI

  1. Step 1 — audit depth. Basic = layers 4, 8, 9. Deep = 9 key layers. Full = all 13. Depth only changes how many layers run, never the method.
  2. Step 2 — target. Type a web-root path (or press Server Root) and browse into a project folder with breadcrumb + folder tree, exactly like the main scanner. Double-click a folder (or “Audit this folder”) to set it as the target. Default = the web root itself.
  3. Step 3 — run. One button. The page then fires one HTTP request per layer (target_info first, then run_layer&layer=N for each layer). The progress bar advances only when a real layer result arrives, and each completed layer is logged with its score, file count and milliseconds.
  4. Result. A compact summary strip (score ring, layers at risk, total findings, top-3 risks) plus a Show Report button that opens the full report in a floating modal: target proof panel, action matrix, collapsible per-layer cards with evidence, gaps and copy-paste remediations. Export JSON downloads the entire report object; Download PDF opens a print-formatted premium report — choose “Save as PDF” in the print dialog.

03What happens per request (the real pipeline)

  1. target_info resolves your folder with the same traversal-proof resolver as the main scanner (SourceIndexer::resolveBaseDir + resolveUrlPath — anything outside the root is refused with a 400), then returns a recursive file census: PHP/JS/CSS/HTML/config counts, capped at 5,000 files.
  2. Each run_layer sets the audit root to your folder, starts a 100-second budget, enumerates that layer's file types (one tree walk per layer, shared across its checks), and runs its patterns.
  3. Dangerous-sink patterns match against real code only: PHP is tokenized and JS is stripped of strings/comments first (newlines preserved, so line numbers stay exact). Detection-rule strings and sample snippets can't match. The displayed snippet always comes from the original source line.
  4. The layer returns its score, gaps, evidence (file + line + matched line), remediations, and proof-of-work stats (files_scanned, scan_ms, truncated, files_sample).
  5. The browser assembles the report client-side from those responses (overall = average, gaps concatenated, top-3 risks = 3 lowest layers). Nothing is stored on the server — reload and it's gone, except your exported JSON.

04What each of the 13 layers actually checks

LayerMethod (honest one-liner)
L01 FrontendScans all JS for dynamic imports, error handlers, old jQuery; all markup for missing alt, inline handlers; finds build configs and .htaccess caching directives anywhere in the tree.
L02 BackendScans all PHP for prepared statements vs interpolated SQL, raw superglobal reads vs validation calls, strict_types, idempotency wording; intra-file taint tracking from $_GET/$_POST to SQL sinks.
L03 DatabasePDO options, transactions, relation definitions across PHP; N+1 heuristic (query positioned after a loop keyword, per file); every .sql file checked for non-idempotent DDL.
L04 AuthToken/JWT usage + expiry/rotation signals, bcrypt vs md5-of-password, cookie flags, session-fixation defence, guard-function vocabulary, lockout mechanics — all per file.
L05 HostingFinds Dockerfiles/compose files anywhere; reads their contents for minimal base, multi-stage, non-root USER, HEALTHCHECK, env isolation, resource limits.
L06 CloudFinds Terraform/K8s/serverless manifests anywhere; reads contents for autoscaling, VPC/subnet, security-group signals.
L07 CI/CDGlobs .github/workflows/* directly (dot-dirs are skipped by the walker); reads contents for lint/test/SAST/dependency/secret-scan stages; detects test suites and signed-commit config.
L08 SecurityUnencoded output, code execution (excluding ->exec() DB calls), unserialize-on-request-data, dynamic includes, password-context weak hashes, DOM sinks in JS, CORS wildcard verified against real header() calls, entropy-based secret detection (values masked), taint flows to output/include/exec. RLS only demanded with tenancy signals.
L09 Rate limitingLimiter vocabulary, algorithm words, per-endpoint buckets, body-size caps, lockout/backoff — per file.
L10 CachingOPcache in Dockerfiles, caching headers in any .htaccess, Redis/Memcached clients, TTL and invalidation vocabulary across code.
L11 ScalingCompose/K8s/nginx contents for replicas, health probes, ingress, zero-downtime update config.
L12 LoggingLogging calls, JSON formatting, correlation IDs, redaction mechanics, APM keywords, alerting words; flags log-calls adjacent to credential keywords and display_errors left on.
L13 BackupsFinds *backup*/*snapshot* scripts anywhere; reads contents for dumps, binlog/PITR, schedules, offsite copies, DR drills; resilience words across PHP.

05How a finding is born (pattern → evidence → score)

  1. A regex matches real code → hit recorded as file + line + matched line.
  2. Hits aggregate into gaps with severity (critical / high / medium / low) and a plain-language impact note.
  3. Score starts at 3 (Baseline), gains for strengths, loses for gaps — then the severity cap applies: any open critical caps the layer at 2/5, any open high caps it at 3/5. Strengths can never whitewash a live flaw.
  4. Each gap ships a remediation with copy-pasteable config/code. Remediation snippets are generic guidance, not auto-generated patches — they don't reference your files.

06Prove it's real (verify it yourself)

Don't take this page's word for it:

07Honest limitations — read this

What this auditor is: a fast, heuristic, static first-pass. What it is not: a replacement for manual review, penetration testing, or a real SAST engine.

08Troubleshooting