Skip to content

armgit / xerj

Public Imported from GitHub
0

AI search engine and MCP server for bots and agents. One Rust binary indexes code, docs, logs, JSONL/CSV and PDFs for BM25 full-text, vector and hybrid search, code search without grep, agent memory and RAG. Elasticsearch-compatible API; Corpus Hub serves hundreds of reference memory corpora.

feat(site): AI security review use case — WordPress core audit case study

xerj-org5a71c1ae9a6d
diff --git a/landing/llms-full.txt b/landing/llms-full.txt
index 43f6d025f..cd2221cc8 100644
--- a/landing/llms-full.txt
+++ b/landing/llms-full.txt
@@ -304,6 +304,26 @@ Document-folder indexing (prior use case):
PDF/DOCX); the differently-phrased set is an honest tie because the built-in
embedder is lexical, not neural.
+AI security review of a codebase too big to read:
+ https://github.com/xerj-org/xerj/tree/main/docs/case-studies/wordpress-security-audit
+ An agent audits real WordPress core — 1,492 PHP files, ~619k lines, ~26× a 200k
+ context window — by indexing the tree as queryable facts (call graph + taint
+ facts, cap/nonce shapes, hook registrations, sanitizer-order fingerprints —
+ built in ≈3.6 s at a 100% tree-sitter-php parse rate — plus a dangerous-call-site
+ census built as a separate pass) and reading only the survivors of each query.
+ The structured audit summed to ~26k tokens vs ~5.2M just to load core once.
+ Honest findings, as the docs state them: core came back hardened on every flow
+ tested (the negative result is the result); the headline finding of three
+ Medium-severity results — wp_http_validate_url missing 169.254.0.0/16, the
+ cloud-metadata range — is a known-class limitation, explicitly not claimed as
+ a novel 0-day (the other two: a deploy-dependent ImageTragick surface in the
+ Imagick image editor, and a role-injection inconsistency in user-new.php
+ caught by the per-file sweep); published counter-examples where grep is the
+ cheaper tool; and the audit surfaced a real XERJ engine bug (term on a keyword
+ array matched only element [0] — memtable half fixed, segment half an open
+ follow-up; the playbook ships the workarounds). The method ships as a copyable
+ playbook + skill retargetable to other stacks.
+
Also validated end-to-end: semantic search & RAG, passage retrieval, vector search
(kNN), vector quantization (SQ8), hybrid search, log analytics, anomaly detection,
continuous anomaly datafeeds, migrate-from-Elasticsearch — all linked from the
@@ -482,4 +502,5 @@ POST /_memory/agent-42/_recall { "query": "what did they ask about security", "
Ingest .................. https://xerj.org/docs/ingest.html
Migration from ES ....... https://xerj.org/docs/migration-from-es.html
Autoindex evaluation .... https://github.com/xerj-org/xerj/tree/main/demo/usecases/autoindex
+ Security-audit study .... https://github.com/xerj-org/xerj/tree/main/docs/case-studies/wordpress-security-audit
Front door (short) ...... https://xerj.org/llms.txt
diff --git a/landing/llms.txt b/landing/llms.txt
index f8784f2ff..de7497b60 100644
--- a/landing/llms.txt
+++ b/landing/llms.txt
@@ -61,6 +61,7 @@ Copy-pasteable, live-validated guides — this is first-class documentation, not
- **Index a folder of documents** — [Document-folder recipe](https://xerj.org/docs/recipes/document-folder-index.html): recursive PDF/DOCX/HTML/MD/TXT → extract + chunk + auto-embed → ranked, cited passages (measured 21/22 answered vs a fair grep baseline's 14/22; the decisive win is binary_only 6/7 vs 0/7 — grep is structurally blind to binary PDF/DOCX; the differently-phrased set is an honest tie on the default lexical embedder — `--embed-mode neural` closes that gap).
- **Zero-config folder → neural semantic search** — [autoindex-semantic recipe](https://xerj.org/docs/recipes/autoindex-semantic-search.html): `xerj autoindex` a mixed folder, then search the discovered prose *by meaning* with the built-in neural embedder (`--embed-mode neural`); structured files (CSV/NDJSON) stay exactly filterable. One binary, no vector DB, no embedding service.
- **All-you-can-eat search (one corpus, five ways)** — [all-way-search recipe](https://xerj.org/docs/recipes/all-way-search.html): index once, retrieve as full-text (BM25), semantic, vector kNN (more-like-this), hybrid (RRF), and semantic-scoped-by-keyword-filter — all from one index, no second datastore.
+- **AI security review of a codebase too big to read** — [WordPress-core case study](https://github.com/xerj-org/xerj/tree/main/docs/case-studies/wordpress-security-audit): an agent audits real WordPress core (1,492 PHP files, ~619k lines — ~26× a 200k context window) by indexing the tree as queryable facts (call graph + taint facts, cap/nonce shapes, hook registrations, sanitizer-order fingerprints — built in ≈3.6 s at a 100% tree-sitter-php parse rate — plus a dangerous-call-site census built as a separate pass), then asking questions grep cannot phrase — "request source + SQL sink + no sanitizer in the same function" narrowed 11,990 functions to 4 candidates in one query. The structured audit summed to ~26k tokens vs ~5.2M just to load core once. Honest findings, stated as the docs state them: core came back hardened on every flow tested (the negative result is the result); the headline finding of three Medium-severity results — `wp_http_validate_url` missing 169.254.0.0/16, the cloud-metadata range, reachable via `pingback_ping` — is a known-class limitation, explicitly not claimed as a novel 0-day (the other two: a deploy-dependent ImageTragick surface in the Imagick image editor, and a role-injection inconsistency in `user-new.php` caught by the per-file sweep); published counter-examples where grep is the cheaper tool; and the audit surfaced a real XERJ engine bug (`term` on a keyword array matched only element [0] — memtable half fixed, segment half an open follow-up; the [playbook](https://github.com/xerj-org/xerj/blob/main/docs/case-studies/wordpress-security-audit/PLAYBOOK.md) ships the workarounds). The reusable pattern: read once to learn an invariant, compile it into an indexed fingerprint, query for violators, read only the survivors.
Supporting evidence, not the headline: in a closed-loop, cache-off benchmark vs live Elasticsearch 8.13.4, XERJ scored 55 wins / 26 ties / 4 losses (3 N/A) across the full matrix, with a 1.72× bulk-ingest win (191k vs 111k docs/s), a 1.61× smaller on-disk footprint, and kNN recall@10 1.00 (unfiltered kNN is now HNSW-served with exact rescoring; k=10 latency ties ES at ~1.8 ms). All 4 losses are the same architectural gap — read p99 under a concurrent write flood (mixed read-under-write); they are published, not hidden. Acked deletes survive SIGTERM/SIGKILL restarts (11/11 adversarial crash cells). Measure on your own workload.
diff --git a/landing/sitemap.xml b/landing/sitemap.xml
index 27e348c73..4e48be91a 100644
--- a/landing/sitemap.xml
+++ b/landing/sitemap.xml
@@ -30,6 +30,41 @@
<lastmod>2026-04-14</lastmod>
<priority>0.8</priority>
</url>
+ <url>
+ <loc>https://xerj.org/use-cases.html</loc>
+ <lastmod>2026-07-27</lastmod>
+ <priority>0.8</priority>
+ </url>
+ <url>
+ <loc>https://xerj.org/use-cases/security-analytics.html</loc>
+ <lastmod>2026-07-27</lastmod>
+ <priority>0.7</priority>
+ </url>
+ <url>
+ <loc>https://xerj.org/use-cases/operational-intelligence.html</loc>
+ <lastmod>2026-07-27</lastmod>
+ <priority>0.7</priority>
+ </url>
+ <url>
+ <loc>https://xerj.org/use-cases/ai-search-retrieval.html</loc>
+ <lastmod>2026-07-27</lastmod>
+ <priority>0.7</priority>
+ </url>
+ <url>
+ <loc>https://xerj.org/use-cases/code-security-audit.html</loc>
+ <lastmod>2026-07-27</lastmod>
+ <priority>0.7</priority>
+ </url>
+ <url>
+ <loc>https://xerj.org/use-cases/elasticsearch-replacement.html</loc>
+ <lastmod>2026-07-27</lastmod>
+ <priority>0.7</priority>
+ </url>
+ <url>
+ <loc>https://xerj.org/use-cases/unified-observability.html</loc>
+ <lastmod>2026-07-27</lastmod>
+ <priority>0.7</priority>
+ </url>
<url>
<loc>https://xerj.org/brand.html</loc>
<lastmod>2026-04-14</lastmod>
diff --git a/landing/solutions/index.html b/landing/solutions/index.html
index 761613d30..e876d50cc 100644
--- a/landing/solutions/index.html
+++ b/landing/solutions/index.html
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XERJ.ai — Solutions</title>
-<meta name="description" content="XERJ by solution — SIEM, RAG, observability, ES replacement, operational intelligence. One platform, five retrieval patterns.">
+<meta name="description" content="XERJ by solution — SIEM, RAG, observability, ES replacement, operational intelligence, AI security review. One platform, six retrieval patterns.">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@400;700;800;900&family=Inter:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">
@@ -42,11 +42,12 @@
<a href="/use-cases/unified-observability.html">UNIFIED OBSERVABILITY</a>
<a href="/use-cases/elasticsearch-replacement.html">ES REPLACEMENT</a>
<a href="/use-cases/operational-intelligence.html">OPERATIONAL INTELLIGENCE</a>
+ <a href="/use-cases/code-security-audit.html">AI SECURITY REVIEW</a>
</nav>
<section class="scene-section" style="border-top:0; padding-top:0;">
<div class="kicker"><span>SOLUTIONS</span><span class="dash">·</span><span>WHAT XERJ REPLACES</span></div>
- <h1 class="hero" style="font-size: var(--fs-96);">ONE PLATFORM.<br><span class="accent">FIVE WORKLOADS.</span></h1>
+ <h1 class="hero" style="font-size: var(--fs-96);">ONE PLATFORM.<br><span class="accent">SIX WORKLOADS.</span></h1>
<p class="lead" style="max-width:720px;">
XERJ ships one binary. Different teams use it differently —
SIEM analysts run one query surface, RAG platform teams run
@@ -57,7 +58,7 @@
<!-- SOLUTION CARDS · simple 2-up grid, no filter overload -->
<section class="scene-section" style="border-top:0;">
- <div class="kicker"><span>FIVE SOLUTIONS</span><span class="dash">·</span><span>PICK THE ONE THAT FITS</span></div>
+ <div class="kicker"><span>SIX SOLUTIONS</span><span class="dash">·</span><span>PICK THE ONE THAT FITS</span></div>
<div class="card-grid">
@@ -142,22 +143,39 @@
<span class="card-cta">EXPLORE OPS INTELLIGENCE →</span>
</a>
+ <a class="card" href="/use-cases/code-security-audit.html">
+ <span class="card-k">06 · AI SECURITY REVIEW</span>
+ <span class="card-t">AUDIT CODE<br><span class="accent">TOO BIG TO READ.</span></span>
+ <span class="card-b">
+ An AI agent indexes a codebase as queryable facts — call
+ sites, call graph, sanitizer order — then reads only the
+ survivors. WordPress core: the structured audit summed to
+ ~26K tokens vs ~5.2M just to load the tree once.
+ </span>
+ <span class="card-facts">
+ FOR CISO · APPSEC · SECURITY RESEARCH<br>
+ 619K LINES INDEXED IN ≈3.6 S · 100% PARSE RATE<br>
+ SINK-CENSUS COVERAGE PROVEN · UNEXPLAINED RESIDUAL 0
+ </span>
+ <span class="card-cta">EXPLORE AI SECURITY REVIEW →</span>
+ </a>
+
</div>
</section>
<!-- HOW IT ALL FITS -->
<section class="scene-section">
- <div class="kicker"><span>ONE PLATFORM</span><span class="dash">·</span><span>FIVE WORKLOADS</span></div>
+ <div class="kicker"><span>ONE PLATFORM</span><span class="dash">·</span><span>SIX WORKLOADS</span></div>
<h2 class="scene">SAME ENGINE.<br><span class="accent">DIFFERENT LENSES.</span></h2>
<p class="wide">
- The five solutions above are not separate products. They are
+ The six solutions above are not separate products. They are
lenses onto one platform. Most enterprise customers run two or
three of them simultaneously on the same binary, the same
segment cache, and the same audit trail.
</p>
- <svg class="diagram" viewBox="0 0 960 420" role="img" aria-label="XERJ fan-out to five retrieval lenses">
+ <svg class="diagram" viewBox="0 0 960 480" role="img" aria-label="XERJ fan-out to six retrieval lenses">
<!-- XERJ node on left -->
<g class="node accent"><rect x="40" y="160" width="260" height="100"/>
<text x="56" y="184" class="label">XERJ</text>
@@ -198,9 +216,15 @@
<text x="496" y="296" class="small">audit · capacity · cost · model-risk evidence</text>
</g>
- <g class="node mute"><rect x="40" y="340" width="900" height="48" class="dashed"/>
- <text x="60" y="362" class="label">ONE CONTRACT · ONE ON-CALL · ONE SOC 2 SCOPE · ONE RBAC MODEL</text>
- <text x="60" y="380" class="small">every lens above runs on the same binary, same audit trail, same RBAC</text>
+ <line x1="300" y1="255" x2="480" y2="340"/><polygon points="478,336 486,342 476,344"/>
+ <g class="node"><rect x="480" y="320" width="460" height="44"/>
+ <text x="496" y="342" class="label">CODE FACTS</text>
+ <text x="496" y="356" class="small">AI security review · call sites · call graph · invariant fingerprints</text>
+ </g>
+
+ <g class="node mute"><rect x="40" y="400" width="900" height="48" class="dashed"/>
+ <text x="60" y="422" class="label">ONE CONTRACT · ONE ON-CALL · ONE SOC 2 SCOPE · ONE RBAC MODEL</text>
+ <text x="60" y="440" class="small">every lens above runs on the same binary, same audit trail, same RBAC</text>
</g>
</svg>
diff --git a/landing/use-cases.html b/landing/use-cases.html
index 28b0e255e..57c197f45 100644
--- a/landing/use-cases.html
+++ b/landing/use-cases.html
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XERJ.ai — Enterprise use cases</title>
-<meta name="description" content="Five enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
+<meta name="description" content="Six enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
<meta property="og:title" content="XERJ.ai — storage for the agent era">
<meta property="og:description" content="An AI-native, Elasticsearch-wire-compatible search + vector + log engine in Rust. Apache-2.0, no lock-in. Live playground + reproducible head-to-head benchmarks.">
<link rel="preconnect" href="https://fonts.googleapis.com">
@@ -42,6 +42,7 @@
<a href="/use-cases/security-analytics.html">SECURITY ANALYTICS</a>
<a href="/use-cases/operational-intelligence.html">OPERATIONAL INTELLIGENCE</a>
<a href="/use-cases/ai-search-retrieval.html">AI SEARCH</a>
+ <a href="/use-cases/code-security-audit.html">AI SECURITY REVIEW</a>
<a href="/use-cases/elasticsearch-replacement.html">ES REPLACEMENT</a>
<a href="/use-cases/unified-observability.html">OBSERVABILITY</a>
</nav>
@@ -50,10 +51,11 @@
<div class="kicker"><span>USE CASES</span><span class="dash">·</span><span>ENTERPRISE</span></div>
<h1 class="hero" style="font-size: var(--fs-96);">REPLACE THE<br>STACK.<br><span class="accent">KEEP THE DATA.</span></h1>
<p class="lead" style="max-width:720px;">
- Five enterprise workloads. One binary. No Logstash, no Beats, no
+ Six enterprise workloads. One binary. No Logstash, no Beats, no
separate vector database, no dedicated Kibana cluster. Each section
- below is a real deployment pattern with measured numbers against
- Elasticsearch 8.13 — and a live chart from the product dashboards.
+ below is a real deployment pattern with measured numbers — benchmarks
+ against Elasticsearch 8.13, or token costs measured on a real audit —
+ and a live chart.
</p>
</section>
@@ -419,6 +421,70 @@
</div>
</div>
+<!-- 06 AI SECURITY REVIEW — token cost to the answer -->
+<div class="uc-showcase">
+ <div class="uc-copy">
+ <span class="uc-num">06</span>
+ <div class="uc-title">AI SECURITY<br><span class="accent">REVIEW.</span></div>
+ <p class="uc-pitch">An AI agent audits a codebase too big to read — real WordPress core, 1,492 PHP files, ~619,000 lines. XERJ becomes the audit substrate: the whole tree indexed as queryable facts in ≈3.6 seconds, then interrogated with questions grep cannot phrase, like "request source + SQL sink + no sanitizer in the same function". The bars compare measured token cost to the answer — and the last two rows are the published counter-examples where grep was the cheaper tool, one of them because the audit surfaced a real XERJ engine bug, reported in the case study.</p>
+ <div class="uc-metric">~26K-TOKEN AUDIT vs ~5.2M TO LOAD THE TREE</div>
+ <div class="uc-persona">CISO · APPSEC ENGINEER · SECURITY RESEARCHER</div>
+ <a href="/use-cases/code-security-audit.html" class="uc-cta">FULL USE CASE →</a>
+ </div>
+ <div class="uc-viz">
+ <div class="kicker"><span>MEASURED · WORDPRESS CORE · docs/case-studies/wordpress-security-audit</span></div>
+ <div class="cmp-bars">
+ <div class="cmp-bars-head">
+ <span></span>
+ <span class="cmp-a">XERJ</span>
+ <span class="cmp-b">GREP + READ</span>
+ </div>
+ <div class="cmp-bars-row">
+ <span class="cmp-label">Sanitizer composition</span>
+ <span class="cmp-val cmp-a">
+ <span class="cmp-bar" style="width:0.1%;"></span>
+ <span class="cmp-num">~490 tok</span>
+ </span>
+ <span class="cmp-val cmp-b">
+ <span class="cmp-bar" style="width:90.0%;"></span>
+ <span class="cmp-num">~1,329,000 tok <span class="cmp-ratio">2,700× more</span></span>
+ </span>
+ </div><div class="cmp-bars-row">
+ <span class="cmp-label">Auth posture sweep</span>
+ <span class="cmp-val cmp-a">
+ <span class="cmp-bar" style="width:1.8%;"></span>
+ <span class="cmp-num">~6,600 tok</span>
+ </span>
+ <span class="cmp-val cmp-b">
+ <span class="cmp-bar" style="width:90.0%;"></span>
+ <span class="cmp-num">~335,500 tok <span class="cmp-ratio">51× more</span></span>
+ </span>
+ </div><div class="cmp-bars-row">
+ <span class="cmp-label">Reachability query</span>
+ <span class="cmp-val cmp-a">
+ <span class="cmp-bar" style="width:90.0%;"></span>
+ <span class="cmp-num">~482,800 tok</span>
+ </span>
+ <span class="cmp-val cmp-b">
+ <span class="cmp-bar" style="width:0.8%;"></span>
+ <span class="cmp-num">~4,300 tok <span class="cmp-ratio">112× less</span></span>
+ </span>
+ </div><div class="cmp-bars-row">
+ <span class="cmp-label">__destruct inventory</span>
+ <span class="cmp-val cmp-a">
+ <span class="cmp-bar" style="width:90.0%;"></span>
+ <span class="cmp-num">~14,700 tok</span>
+ </span>
+ <span class="cmp-val cmp-b">
+ <span class="cmp-bar" style="width:4.0%;"></span>
+ <span class="cmp-num">~649 tok <span class="cmp-ratio">23× less</span></span>
+ </span>
+ </div>
+ </div>
+ <p style="margin-top:14px; font-size:12px; letter-spacing:.04em; color:var(--z-mute); font-family:var(--font-data);">TOKEN COST TO THE ANSWER · NOT LATENCY · LAST TWO ROWS: THE PUBLISHED COUNTER-EXAMPLES WHERE GREP WINS — REACHABILITY IS THE AUDIT-TIME MEASUREMENT UNDER THE KEYWORD-ARRAY TERM BUG THE AUDIT ITSELF SURFACED · SOURCES IN <a href="https://github.com/xerj-org/xerj/tree/main/docs/case-studies/wordpress-security-audit" rel="external">docs/case-studies/wordpress-security-audit →</a></p>
+ </div>
+</div>
+
<section class="lead-capture" id="demo">
<div class="kicker"><span>READY?</span><span class="dash">·</span><span>REQUEST ACCESS</span></div>
<h3>RUN IT ON<br><span class="accent">YOUR DATA.</span></h3>
diff --git a/landing/use-cases/ai-search-retrieval.html b/landing/use-cases/ai-search-retrieval.html
index ed2788e1f..c05351285 100644
--- a/landing/use-cases/ai-search-retrieval.html
+++ b/landing/use-cases/ai-search-retrieval.html
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XERJ.ai — Enterprise use cases</title>
-<meta name="description" content="Five enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
+<meta name="description" content="Six enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
<meta property="og:title" content="XERJ.ai — storage for the agent era">
<meta property="og:description" content="An AI-native, Elasticsearch-wire-compatible search + vector + log engine in Rust. Apache-2.0, no lock-in. Live playground + reproducible head-to-head benchmarks.">
<link rel="preconnect" href="https://fonts.googleapis.com">
@@ -42,6 +42,7 @@
<a href="/use-cases/security-analytics.html">SECURITY ANALYTICS</a>
<a href="/use-cases/operational-intelligence.html">OPERATIONAL INTELLIGENCE</a>
<a href="/use-cases/ai-search-retrieval.html" class="active">AI SEARCH</a>
+ <a href="/use-cases/code-security-audit.html">AI SECURITY REVIEW</a>
<a href="/use-cases/elasticsearch-replacement.html">ES REPLACEMENT</a>
<a href="/use-cases/unified-observability.html">OBSERVABILITY</a>
</nav>
diff --git a/landing/use-cases/code-security-audit.html b/landing/use-cases/code-security-audit.html
new file mode 100644
index 000000000..7e99f1d95
--- /dev/null
+++ b/landing/use-cases/code-security-audit.html
@@ -0,0 +1,472 @@
+<!DOCTYPE html>
+<html lang="en" data-theme="night">
+<head>
+<meta charset="UTF-8">
+<meta name="viewport" content="width=device-width, initial-scale=1.0">
+<title>XERJ.ai — AI security review of a codebase too big to read</title>
+<meta name="description" content="An AI agent audits real WordPress core — 1,492 PHP files, ~619k lines — through XERJ: the structured audit summed to ~26,000 tokens vs ~5,200,000 to load the tree once. Sources in docs/case-studies/wordpress-security-audit.">
+<meta property="og:title" content="XERJ.ai — AI security review of a codebase too big to read">
+<meta property="og:description" content="An AI agent audits real WordPress core through XERJ instead of reading it: a ~26,000-token structured audit vs ~5,200,000 tokens to load the tree once — measured on a real audit, counter-examples included.">
+<link rel="preconnect" href="https://fonts.googleapis.com">
+<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
+<link href="https://fonts.googleapis.com/css2?family=Big+Shoulders+Display:wght@400;700;800;900&family=Inter:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet">
+<link rel="icon" href="data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'><rect width='100' height='100' fill='%230b0b0d'/><text x='50' y='68' font-size='60' font-family='Big Shoulders Display,sans-serif' font-weight='900' fill='%23ffc400' text-anchor='middle'>X</text></svg>">
+<link rel="stylesheet" href="/style.css?v=sc0706">
+</head>
+<body>
+
+<!-- nav -->
+<nav class="nav" aria-label="Primary">
+ <a href="/index.html" class="brand">XERJ.AI</a>
+ <a href="/index.html">HOME</a>
+ <a href="/product.html">PRODUCT</a>
+ <span class="nav-drop active">
+ <a href="/use-cases.html" class="active">USE CASES</a>
+ </span>
+ <span class="spacer"></span>
+ <a href="/for-agents.html">FOR AGENTS</a>
+ <a href="/docs/index.html">DOCS</a>
+ <a href="/docs/recipes/index.html">RECIPES</a>
+ <a href="/playground.html">DASHBOARDS</a>
+ <a href="https://github.com/xerj-org/xerj" rel="external">GITHUB</a>
+ <span class="theme">
+ <button type="button" data-theme="day">DAY</button>
+ <span class="dash">·</span>
+ <button type="button" data-theme="night" class="active">NIGHT</button>
+ </span>
+</nav>
+
+
+<nav class="uc-subnav" aria-label="Use cases">
+ <a href="/use-cases.html">ALL USE CASES</a>
+ <a href="/use-cases/security-analytics.html">SECURITY ANALYTICS</a>
+ <a href="/use-cases/operational-intelligence.html">OPERATIONAL INTELLIGENCE</a>
+ <a href="/use-cases/ai-search-retrieval.html">AI SEARCH</a>
+ <a href="/use-cases/code-security-audit.html" class="active">AI SECURITY REVIEW</a>
+ <a href="/use-cases/elasticsearch-replacement.html">ES REPLACEMENT</a>
+ <a href="/use-cases/unified-observability.html">OBSERVABILITY</a>
+</nav>
+
+<div class="uc-hero">
+ <div class="uc-eyebrow">USE CASE · AI SECURITY REVIEW</div>
+ <h1>SECURITY REVIEW<br>OF A CODEBASE<br><span class="accent">TOO BIG TO READ.</span></h1>
+ <p class="uc-lead">Real WordPress core is 1,492 PHP files and ~619,000 lines — about 26× a 200k-token context window, so an agent that reads everything must chunk, and chunking destroys the cross-file traces where authorization bugs live. In this case study an AI agent used XERJ as its retrieval substrate instead: index the whole tree in ≈3.6 seconds, then interrogate it. The entire structured audit summed to ~26,000 tokens, against ~5,200,000 just to load core once.</p>
+ <div class="kicker"><span>FOR</span><span class="dash">·</span><span>CISO</span><span class="dash">·</span><span>APPSEC ENGINEER</span><span class="dash">·</span><span>SECURITY RESEARCHER</span></div>
+</div>
+
+<!-- Hero chart -->
+<section class="scene-section" style="border-top:0; padding-top:0;">
+ <div class="viz-block">
+ <div class="kicker"><span>TOKENS TO THE ANSWER · REAL WORDPRESS CORE · EACH ROW SCALED TO ITS OWN BASELINE</span></div>
+ <div class="cmp-bars">
+ <div class="cmp-bars-head">
+ <span></span>
+ <span class="cmp-a">XERJ</span>
+ <span class="cmp-b">GREP + READ</span>
+ </div>
+ <div class="cmp-bars-row">
+ <span class="cmp-label">Sanitizer composition</span>
+ <span class="cmp-val cmp-a">
+ <span class="cmp-bar" style="width:0.1%;"></span>
+ <span class="cmp-num">~490 tok</span>
+ </span>
+ <span class="cmp-val cmp-b">
+ <span class="cmp-bar" style="width:90.0%;"></span>
+ <span class="cmp-num">~1,329,000 tok <span class="cmp-ratio">2,700× more</span></span>
+ </span>
+ </div><div class="cmp-bars-row">
+ <span class="cmp-label">Auth posture sweep</span>
+ <span class="cmp-val cmp-a">
+ <span class="cmp-bar" style="width:1.8%;"></span>
+ <span class="cmp-num">~6,600 tok</span>
+ </span>
+ <span class="cmp-val cmp-b">
+ <span class="cmp-bar" style="width:90.0%;"></span>
+ <span class="cmp-num">~335,500 tok <span class="cmp-ratio">51× more</span></span>
+ </span>
+ </div><div class="cmp-bars-row">
+ <span class="cmp-label">Reachability query</span>
+ <span class="cmp-val cmp-a">
+ <span class="cmp-bar" style="width:90.0%;"></span>
+ <span class="cmp-num">~482,800 tok</span>
+ </span>
+ <span class="cmp-val cmp-b">
+ <span class="cmp-bar" style="width:0.8%;"></span>
+ <span class="cmp-num">~4,300 tok <span class="cmp-ratio">112× less</span></span>
+ </span>
+ </div><div class="cmp-bars-row">
+ <span class="cmp-label">__destruct inventory</span>
+ <span class="cmp-val cmp-a">
+ <span class="cmp-bar" style="width:90.0%;"></span>
+ <span class="cmp-num">~14,700 tok</span>
+ </span>
+ <span class="cmp-val cmp-b">
+ <span class="cmp-bar" style="width:4.0%;"></span>
+ <span class="cmp-num">~649 tok <span class="cmp-ratio">23× less</span></span>
+ </span>
+ </div>
+ </div>
+ <p style="margin-top:14px; font-size:12px; letter-spacing:.04em; color:var(--z-mute); font-family:var(--font-data);">TOKEN COST TO THE ANSWER · NOT LATENCY · THE LAST TWO ROWS ARE THE PUBLISHED COUNTER-EXAMPLES, WHERE GREP IS THE CHEAPER TOOL — REACHABILITY IS THE AUDIT-TIME MEASUREMENT, WHERE THE KEYWORD-ARRAY TERM BUG (02 BELOW) FORCED A SCROLL-AND-TRAVERSE WORKAROUND; THE ~170-TOK SINGLE QUERY IS A PROJECTION FOR AFTER THE FIX FULLY LANDS, NOT A MEASUREMENT · SOURCES IN <a href="https://github.com/xerj-org/xerj/tree/main/docs/case-studies/wordpress-security-audit" rel="external">docs/case-studies/wordpress-security-audit &rarr;</a></p>
+ </div>
+</section>
+
+<div class="pain-solve">
+ <div class="pain">
+ <h3>THE READ-EVERYTHING PROBLEM</h3>
+ <ul><li><strong>The codebase does not fit.</strong> 1,492 PHP files, ~619,000 lines, ~5,200,000 tokens just to load — roughly 26× a 200k window, which holds about 4% of core at a time.</li><li><strong>Chunking destroys the bug class you are hunting.</strong> Authorization and taint defects are interprocedural; split the tree across windows and the cross-file trace is gone before the reasoning starts.</li><li><strong>grep is file-scoped.</strong> It cannot express "a request source and a SQL sink in the same function with no sanitizer", or "an unauthenticated hook reaches a dangerous call".</li><li><strong>Skimming produces prose, not evidence.</strong> A pass over 5.2M tokens of unfamiliar code yields plausible narrative; a reviewer needs a file and a line they can open.</li><li><strong>Nothing is reproducible.</strong> Two runs read different files and reach different conclusions, and there is no artifact to re-run against next release.</li></ul>
+ </div>
+ <div class="solve">
+ <h3>THE XERJ ANSWER</h3>
+ <ul><li><strong>Index once, interrogate many times.</strong> Five live indices — 11,990 functions with taint facts, 11,990 cap/nonce shapes, 1,343 hook registrations and 2,445 sanitizer-sequence fingerprints built in ≈3.6 s at a 100% <code>tree-sitter-php</code> parse rate, plus an 11,191-site dangerous-call census built as a separate pass.</li><li><strong>Ask what grep cannot phrase.</strong> "Request source + SQL sink + no sanitizer on the path" narrowed 11,990 functions to 4 candidates in one query; grep hands you 51 whole files.</li><li><strong>Compile the invariant, query the violators.</strong> Read once to learn the rule (escaper last before the sink), index it as a fingerprint, then one query returns only the code that breaks it — a measured ~2,700× token reduction on the composition audit.</li><li><strong>The read budget goes to survivors.</strong> The whole structured audit summed to ~26,000 tokens, and every claim in it cites pulled <code>file:line</code> code rather than recollection.</li><li><strong>Coverage is provable, not asserted.</strong> 12,214 grep occurrences of the catalogued names reconciled against 10,778 AST call sites, the remaining 1,436 each proven a non-call: unexplained residual 0.</li></ul>
+ </div>
+</div>
+
+<div class="proof-row">
+
+ <div class="stat">
+ <div class="num">~26,000</div>
+ <div class="label">TOKENS FOR THE AUDIT</div>
+ <div class="ctx">vs ~5,200,000 to load core once · sum of per-phase costs</div>
+ </div>
+
+ <div class="stat">
+ <div class="num">3.6 s</div>
+ <div class="label">TO BUILD THE SUBSTRATE</div>
+ <div class="ctx">1,492 php files · 11,990 functions · 100% parse rate</div>
+ </div>
+
+ <div class="stat">
+ <div class="num">0</div>
+ <div class="label">UNEXPLAINED SINK-CALL GAPS</div>
+ <div class="ctx">12,214 grep hits reconciled · catalogued built-ins only</div>
+ </div>
+
+</div>
+
+
+<section class="scene-section">
+ <h2 class="scene" style="font-size:var(--fs-56);">EVERY ENTRY POINT, <span class="accent">ONE QUESTION.</span></h2>
+ <p class="wide">WordPress accreted four request-entry surfaces over twenty years, and a correct check on AJAX means nothing if the same operation is reachable unguarded over REST or XML-RPC. The auth-posture facts — is the capability bound to the object, is there a nonce, which caps — are one query per surface over the index: 310 per-entry-point facts across AJAX, REST and XML-RPC, plus the 41 file-scope wp-admin handlers whose guards live in the shared preamble. Then the agent reads what looks wrong.</p>
+ <div class="bench">
+ <div class="head">SURFACE · WORDPRESS CORE</div>
+ <div class="head num">ENTRY POINTS</div>
+ <div class="head num">MISSING CAP</div>
+ <div class="head num">IDOR</div>
+
+ <div class="cell test">AJAX · <code class="inline">wp_ajax_*</code></div>
+ <div class="cell num es">97</div>
+ <div class="cell num xy">0</div>
+ <div class="cell num delta">0</div>
+ <div class="cell source">95 authenticated handlers swept for IDOR · the 2 nopriv endpoints (generate-password, heartbeat) are unauthenticated by design · a few self-scoped prefs need no cap</div>
+
+ <div class="cell test">REST · <code class="inline">*_permissions_check</code></div>
+ <div class="cell num es">107</div>
+ <div class="cell num xy">0</div>
+ <div class="cell num delta">0</div>
+ <div class="cell source">object-scoped meta-cap one hop into check_*_permission($obj) · 90 permission checks swept for IDOR (33 mutating + 57 read)</div>
+
+ <div class="cell test">admin-post / direct wp-admin</div>
+ <div class="cell num es">41</div>
+ <div class="cell num xy">0</div>
+ <div class="cell num delta">0</div>
+ <div class="cell source">file-scope handlers · guards live in the shared preamble / fall-through</div>
+
+ <div class="cell test">XML-RPC · class-wp-xmlrpc-server</div>
+ <div class="cell num es">106</div>
+ <div class="cell num xy">—</div>
+ <div class="cell num delta">—</div>
+ <div class="cell source">66 methods call login() · 68 cap-check · the unauthenticated set (pingback.*, demo.*, mt.supportedMethods) is known and intentional · the residual risk is architectural — system.multicall brute-force amplification and pingback SSRF, not a code bug</div>
+
+ <div class="cell test">Posture facts · AJAX + REST + XML-RPC</div>
+ <div class="cell num es">310</div>
+ <div class="cell num xy">0</div>
+ <div class="cell num delta">0</div>
+ <div class="cell source">the set the ~6,600-token posture query covered · the 41 admin-post handlers are file-scope guards audited separately · missing · insufficient · broken-'==' · race — all four failure classes checked on every state-changing entry point · map_meta_cap fails closed · source: AUTHENTICATION.md</div>
+ </div>
+ <p class="wide">That is the honest headline of the audit: on the flows tested, core is hardened. The zeros are scoped exactly as the source scopes them — no missing, insufficient, broken-'==' or race auth flaw on any state-changing entry point, and 0 IDOR across the swept sets: 95 authenticated AJAX handlers and 90 REST permission checks. The negative result is the result — and it is only worth anything because the census can show what was covered.</p>
+</section>
+
+
+<section class="scene-section">
+ <div class="viz-block">
+ <div class="kicker"><span>SINK CENSUS · 11,191 CALL SITES OF 275 CATALOGUED BUILT-INS · SHARE OF THE CENSUS</span></div>
+ <div class="topn-list">
+ <div class="row">
+ <div class="row__label">xss · echo/print</div>
+ <div class="row__val">3,799</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="200.0" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">33.9%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">lfi/rfi · include/require</div>
+ <div class="row__val">1,385</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="72.9" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">12.4%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">type-juggle auth-bypass</div>
+ <div class="row__val">1,240</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="65.3" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">11.1%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">xss-or-info · printf/var_dump</div>
+ <div class="row__val">1,034</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="54.4" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">9.2%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">dynamic callables</div>
+ <div class="row__val">954</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="50.2" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">8.5%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">redos · ereg</div>
+ <div class="row__val">709</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="37.3" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">6.3%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">rce-code · eval/assert</div>
+ <div class="row__val">467</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="24.6" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">4.2%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">file-read</div>
+ <div class="row__val">328</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="17.3" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">2.9%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">sql drivers</div>
+ <div class="row__val">200</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="10.5" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">1.8%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">ssrf</div>
+ <div class="row__val">107</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="5.6" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">1.0%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">deserialization</div>
+ <div class="row__val">13</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="0.7" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">0.1%</div>
+ </div>
+ <div class="row">
+ <div class="row__label">rce-command</div>
+ <div class="row__val">11</div>
+ <div class="row__bar">
+ <svg class="chart" height="6" viewBox="0 0 200 6" preserveAspectRatio="none">
+ <line x1="0" y1="5" x2="0.6" y2="5" stroke="currentColor" stroke-width="1"/>
+ </svg>
+ </div>
+ <div class="row__pct">0.1%</div>
+ </div>
+ </div>
+ <p style="margin-top:14px; font-size:12px; letter-spacing:.04em; color:var(--z-mute); font-family:var(--font-data);">ALL OF CORE HOLDS 11 COMMAND-EXECUTION AND 13 DESERIALIZATION SINKS — 24/24 CARRY A FULL AGENT VERDICT; 1,472 SITES ARE QUEUED AT SEVERITY:REVIEW AND THE REMAINING ~9,700 ARE CENSUSED BUT NOT YET TRIAGED · SINK COVERAGE IS NOT TOTAL VULNERABILITY COVERAGE: LOGIC BUGS, MISSING-AUTHZ AND INCOMPLETE VALIDATORS ARE OUT OF ITS SCOPE</p>
+ </div>
+</section>
+
+
+<section class="scene-section">
+ <h2 class="scene" style="font-size:var(--fs-56);">GREP IS FILE-SCOPED. <span class="accent">THE INDEX IS NOT.</span></h2>
+ <p class="wide">"A request source and a SQL sink in the same function, with no sanitizer on the path" is not a text pattern — it is a join over facts. Asked as a query, it narrows 11,990 functions to 4 candidates that the agent then reads in full. Asked with grep, it hands you 51 whole files and a reading job.</p>
+ <pre class="code">$ curl -s "$XERJ/wpaudit/_search" -H 'Content-Type: application/json' \
+ -d '{"query":{"bool":{"filter":[
+ {"term":{"has_source":"true"}},
+ {"term":{"sinks":"sql"}},
+ {"term":{"sanit":"false"}}]}}}'
+<span class="comment"># 11,990 functions → 4 candidates · the agent reads the 4</span></pre>
+ <p class="wide">The rest of the sweep has the same shape. Only 2 of 1,343 registered hooks are unauthenticated, and the single unauth data path is <code class="inline">heartbeat_nopriv_received</code>. The check-vs-use detector returned 12 IDOR candidates, and the one genuinely risky shape — a revisions controller that checks the capability on the parent and returns by id — is explicitly guarded by a parent-mismatch 404. Twenty-three sanitizer-order flags all cleared on reading, because core holds escaper-last-before-sink everywhere. Every one of those answers is a query plus a short read, not a reading pass over the tree.</p>
+</section>
+
+
+<section class="scene-section">
+ <h2 class="scene" style="font-size:var(--fs-56);">THE HEADLINE FINDING, <span class="accent">STATED PLAINLY.</span></h2>
+ <p class="wide">Core's SSRF gatekeeper — <code class="inline">wp_http_validate_url</code>, which guards <code class="inline">wp_safe_remote_get/post/request</code> and XML-RPC pingbacks — rejects loopback, 10/8, 0/8, 172.16/12 and 192.168/16, but not 169.254.0.0/16, the link-local range that contains the cloud-metadata endpoint 169.254.169.254. CGNAT 100.64/10 and IPv6 are missing as well. It surfaced by <em>reading</em> the range coverage: a pattern scanner cannot see an allow-list that is merely incomplete.</p>
+ <p class="wide">It was then verified by execution rather than by argument. With no PHP runtime available, the validator was ported line-for-line to Python — same scheme filter, same <code class="inline">strpbrk(host, ':#?[]')</code>, same octet test — and run with real DNS resolution: 127.0.0.1, 10.1.2.3, 192.168.0.1 and [::1] were rejected, and the metadata URL was allowed. Reachability was traced to real input: <code class="inline">WP_XMLRPC_Server::pingback_ping</code> takes an attacker-supplied source URL where XML-RPC is enabled, and <code class="inline">WP_REST_URL_Details_Controller::get_remote_url</code> takes a user-supplied <code class="inline">url</code> parameter at author level. The finding was independently re-discovered by a per-file sweep at <code class="inline">wp-includes/http.php:598</code>.</p>
+ <p class="wide"><strong>The honest framing the case study insists on:</strong> this is a known-<em>class</em> limitation at Medium severity, not a novel 0-day and not claimed as one. Core has long treated <code class="inline">wp_http_validate_url</code> as best-effort and points hardening at the <code class="inline">http_request_host_is_external</code> filter; exploitation requires the SSRF path enabled in a cloud environment, and nothing was exploited here — the ALLOWED verdict is the validator's own, on a ported copy. The suggested remediation is defense-in-depth: add 169.254.0.0/16, 100.64.0.0/10 and IPv6 loopback/ULA to the default deny-list, and re-resolve the host at request time to blunt DNS-rebinding TOCTOU. And it is the headline of <em>three</em> Medium-severity results, not the only one: the other two are the deploy-dependent ImageTragick surface in the Imagick image editor, which parses uploaded image content, and the role-injection inconsistency in <code class="inline">wp-admin/user-new.php</code> described under 04 below.</p>
+</section>
+
+
+<section class="scene-section">
+ <h2 class="scene" style="font-size:var(--fs-56);">WHAT IT <span class="accent">GOT WRONG.</span></h2>
+ <p class="wide">An AI-assisted audit is only worth publishing if it reports its own failures. This one ships four, in the same repository as the findings.</p>
+ <div class="laws">
+ <div class="n">01</div>
+ <div class="law">
+ <div class="t">XERJ DOES NOT <span class="accent">FIND BUGS.</span></div>
+ <div class="b">
+ The AST taint and authorization model produces candidates; XERJ stores them
+ and answers questions about them, and a human or an agent reads the survivors.
+ Recall is bounded by that model — a source at file scope, or laundered through
+ <code class="inline">$GLOBALS</code>, is invisible to it — and the detectors have known
+ false-positive drivers. The 70 source-to-sink flows the taint pass returned are
+ high-recall candidates, not vulnerabilities: three of the top SQL flows are
+ documented false positives, and the one real candidate is gated behind an opt-in.
+ </div>
+ </div>
+
+ <div class="n">02</div>
+ <div class="law">
+ <div class="t">THE AUDIT SURFACED A <span class="accent">REAL ENGINE BUG.</span></div>
+ <div class="b">
+ A reverse call-graph query — "who calls <code class="inline">wp_safe_remote_get</code>" —
+ returned 1 hit from the structured term index against 9 from full-text and 14 files
+ from grep. A silent false negative is the worst possible error in a security audit.
+ The root cause was proven rather than guessed: a keyword field stored one value per
+ document, so for an array only element [0] was indexed — a real compatibility break,
+ since a keyword array is multi-valued in Elasticsearch. The memtable half of the fix
+ has landed; the segment half is an open design follow-up and its regression test is
+ still ignore-marked in the repo. A second, smaller bug: a boolean <code class="inline">term</code>
+ matched as a string. The audit's interprocedural conclusions were computed over pulled
+ <code class="inline">_source</code> and cross-checked against full-text and grep, never through
+ the broken path — which is why they still hold, and why the published playbook ships
+ the workarounds as caveats to the agent.
+ </div>
+ </div>
+
+ <div class="n">03</div>
+ <div class="law">
+ <div class="t">SOMETIMES <span class="accent">GREP WINS.</span></div>
+ <div class="b">
+ For the narrow question "which <code class="inline">__destruct</code> methods are dangerous" —
+ twelve short methods — grep plus reading cost ~649 tokens against XERJ's ~14,700, and both
+ returned the identical answer. The published rule is to use the cheaper tool for the question
+ at hand. An index earns its cost when the question is broad, interprocedural, or asked
+ repeatedly over the same corpus; for raw "who calls X" reachability, grep needs no index and
+ no server, and it was the more reliable tool at the time of this audit.
+ </div>
+ </div>
+
+ <div class="n">04</div>
+ <div class="law">
+ <div class="t">THE STRUCTURAL PASS <span class="accent">MISSED ONE.</span></div>
+ <div class="b">
+ An exhaustive per-file sweep — 222 agents, ~10.8M tokens, ~31 minutes over the 883
+ security-relevant files, producing 44 candidates that adversarial verification cut to 5 —
+ found a role-injection inconsistency in <code class="inline">wp-admin/user-new.php</code>: two of the
+ three sinks that assign a request-supplied role call <code class="inline">wp_ensure_editable_role()</code>,
+ and the email-invitation branch does not. The structural authz graph passed that file, because a
+ capability check <em>was</em> present and a presence-of-check model cannot see a missing sibling guard.
+ On a stock install no privilege boundary is crossed — <code class="inline">get_editable_roles()</code>
+ returns every role, so the guard is a no-op — and it bites only on multisite where an
+ <code class="inline">editable_roles</code> filter restricts the inviter below the injected role. A genuine
+ unconditional inconsistency worth a hardening fix, not a stock-install escalation. Neither pass alone
+ finds it: the deep sweep is the periodic backstop, the ~26,000-token structural passes are the daily driver.
+ </div>
+ </div>
+ </div>
+</section>
+
+
+<section class="scene-section">
+ <h2 class="scene" style="font-size:var(--fs-56);">READ THE <span class="accent">CASE STUDY.</span></h2>
+ <p class="wide">Everything above is published: the findings with their honest severities, the reproduction commands, the counter-examples where the index lost, and the verbatim prompts that drove the agent. Setup is roughly two minutes — install the extractor, clone WordPress, run three index scripts — and the method ships as a copyable skill that retargets to another stack by editing the catalog, because the taint model is data, not code.</p>
+ <div style="display:flex; gap:var(--sp-6); margin-top:var(--sp-6); flex-wrap:wrap;">
+ <a href="https://github.com/xerj-org/xerj/tree/main/docs/case-studies/wordpress-security-audit" rel="external" class="cta" style="font-size:var(--fs-20); padding:var(--sp-4) 0; border-bottom:0; flex:1; min-width:280px;">
+ <span>OPEN THE CASE STUDY</span>
+ <span class="arrow">→</span>
+ </a>
+ <a href="https://github.com/xerj-org/xerj/blob/main/docs/case-studies/wordpress-security-audit/PLAYBOOK.md" rel="external" class="cta" style="font-size:var(--fs-20); padding:var(--sp-4) 0; border-bottom:0; flex:1; min-width:280px;">
+ <span>OPEN THE PLAYBOOK</span>
+ <span class="arrow">→</span>
+ </a>
+ </div>
+</section>
+
+<section class="lead-capture" id="demo">
+ <div class="kicker"><span>READY?</span><span class="dash">·</span><span>REQUEST ACCESS</span></div>
+ <h3>RUN IT ON<br><span class="accent">YOUR DATA.</span></h3>
+ <p>Send us your stack and the invariant you actually care about — the sanitizer rule, the capability shape, the range check. We'll come back with the index schema, the queries that express it, and the token budget for the sweep.</p>
+ <form class="lead-form" id="leadForm" action="#" method="post" novalidate>
+ <input type="email" name="email" placeholder="[email protected]" required aria-label="Work email" autocomplete="email" />
+ <button type="submit" class="demo">SEE THE DEMO <span class="arrow">→</span></button>
+ <span class="note">We only use this email to follow up about XERJ — nothing else. No spam, no reselling.</span>
+ <span class="ok">✓ THANKS. WE'LL FOLLOW UP WITHIN ONE BUSINESS DAY.</span>
+ </form>
+</section>
+
+<footer class="footer">
+ <span>XERJ.AI · USE CASES · V0.1</span>
+ <span>STORAGE FOR THE AGENT ERA</span>
+ <span><a href="/index.html">HOME</a> · <a href="/use-cases.html">ALL USE CASES</a> · <a href="/docs/index.html">DOCS</a> · <a href="/playground.html">DASHBOARDS</a> &middot; <a href="/llms.txt">LLMS.TXT</a></span>
+</footer>
+
+<script>
+ (function () {
+ const root = document.documentElement;
+ for (const btn of document.querySelectorAll('[data-theme]')) {
+ btn.addEventListener('click', () => {
+ const t = btn.getAttribute('data-theme');
+ root.setAttribute('data-theme', t);
+ for (const b of document.querySelectorAll('[data-theme]')) {
+ b.classList.toggle('active', b.getAttribute('data-theme') === t);
+ }
+ });
+ }
+ const form = document.getElementById('leadForm');
+ if (form) {
+ form.addEventListener('submit', (e) => {
+ e.preventDefault();
+ const email = form.querySelector('input[type=email]').value.trim();
+ if (!email || !email.includes('@')) return;
+ console.log('[xerj lead]', email);
+ try { fetch('/lead', { method: 'POST', headers: { 'content-type': 'application/json' }, body: JSON.stringify({ email: email, source: 'code-security-audit' }), keepalive: true }).catch(function () {}); } catch (_) {}
+ form.classList.add('sent');
+ });
+ }
+ })();
+</script>
+
+</body>
+</html>
diff --git a/landing/use-cases/elasticsearch-replacement.html b/landing/use-cases/elasticsearch-replacement.html
index 4d093b313..ebe7d5701 100644
--- a/landing/use-cases/elasticsearch-replacement.html
+++ b/landing/use-cases/elasticsearch-replacement.html
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XERJ.ai — Enterprise use cases</title>
-<meta name="description" content="Five enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
+<meta name="description" content="Six enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
<meta property="og:title" content="XERJ.ai — storage for the agent era">
<meta property="og:description" content="An AI-native, Elasticsearch-wire-compatible search + vector + log engine in Rust. Apache-2.0, no lock-in. Live playground + reproducible head-to-head benchmarks.">
<link rel="preconnect" href="https://fonts.googleapis.com">
@@ -42,6 +42,7 @@
<a href="/use-cases/security-analytics.html">SECURITY ANALYTICS</a>
<a href="/use-cases/operational-intelligence.html">OPERATIONAL INTELLIGENCE</a>
<a href="/use-cases/ai-search-retrieval.html">AI SEARCH</a>
+ <a href="/use-cases/code-security-audit.html">AI SECURITY REVIEW</a>
<a href="/use-cases/elasticsearch-replacement.html" class="active">ES REPLACEMENT</a>
<a href="/use-cases/unified-observability.html">OBSERVABILITY</a>
</nav>
diff --git a/landing/use-cases/operational-intelligence.html b/landing/use-cases/operational-intelligence.html
index 0fe800dfe..1508cac26 100644
--- a/landing/use-cases/operational-intelligence.html
+++ b/landing/use-cases/operational-intelligence.html
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XERJ.ai — Enterprise use cases</title>
-<meta name="description" content="Five enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
+<meta name="description" content="Six enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
<meta property="og:title" content="XERJ.ai — storage for the agent era">
<meta property="og:description" content="An AI-native, Elasticsearch-wire-compatible search + vector + log engine in Rust. Apache-2.0, no lock-in. Live playground + reproducible head-to-head benchmarks.">
<link rel="preconnect" href="https://fonts.googleapis.com">
@@ -42,6 +42,7 @@
<a href="/use-cases/security-analytics.html">SECURITY ANALYTICS</a>
<a href="/use-cases/operational-intelligence.html" class="active">OPERATIONAL INTELLIGENCE</a>
<a href="/use-cases/ai-search-retrieval.html">AI SEARCH</a>
+ <a href="/use-cases/code-security-audit.html">AI SECURITY REVIEW</a>
<a href="/use-cases/elasticsearch-replacement.html">ES REPLACEMENT</a>
<a href="/use-cases/unified-observability.html">OBSERVABILITY</a>
</nav>
diff --git a/landing/use-cases/security-analytics.html b/landing/use-cases/security-analytics.html
index 2d8711030..aaa3209ab 100644
--- a/landing/use-cases/security-analytics.html
+++ b/landing/use-cases/security-analytics.html
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XERJ.ai — Enterprise use cases</title>
-<meta name="description" content="Five enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
+<meta name="description" content="Six enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
<meta property="og:title" content="XERJ.ai — storage for the agent era">
<meta property="og:description" content="An AI-native, Elasticsearch-wire-compatible search + vector + log engine in Rust. Apache-2.0, no lock-in. Live playground + reproducible head-to-head benchmarks.">
<link rel="preconnect" href="https://fonts.googleapis.com">
@@ -42,6 +42,7 @@
<a href="/use-cases/security-analytics.html" class="active">SECURITY ANALYTICS</a>
<a href="/use-cases/operational-intelligence.html">OPERATIONAL INTELLIGENCE</a>
<a href="/use-cases/ai-search-retrieval.html">AI SEARCH</a>
+ <a href="/use-cases/code-security-audit.html">AI SECURITY REVIEW</a>
<a href="/use-cases/elasticsearch-replacement.html">ES REPLACEMENT</a>
<a href="/use-cases/unified-observability.html">OBSERVABILITY</a>
</nav>
diff --git a/landing/use-cases/unified-observability.html b/landing/use-cases/unified-observability.html
index f8399993f..5a767e365 100644
--- a/landing/use-cases/unified-observability.html
+++ b/landing/use-cases/unified-observability.html
@@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>XERJ.ai — Enterprise use cases</title>
-<meta name="description" content="Five enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
+<meta name="description" content="Six enterprise workloads. One binary. Measured benchmarks vs ES 8.13.">
<meta property="og:title" content="XERJ.ai — storage for the agent era">
<meta property="og:description" content="An AI-native, Elasticsearch-wire-compatible search + vector + log engine in Rust. Apache-2.0, no lock-in. Live playground + reproducible head-to-head benchmarks.">
<link rel="preconnect" href="https://fonts.googleapis.com">
@@ -42,6 +42,7 @@
<a href="/use-cases/security-analytics.html">SECURITY ANALYTICS</a>
<a href="/use-cases/operational-intelligence.html">OPERATIONAL INTELLIGENCE</a>
<a href="/use-cases/ai-search-retrieval.html">AI SEARCH</a>
+ <a href="/use-cases/code-security-audit.html">AI SECURITY REVIEW</a>
<a href="/use-cases/elasticsearch-replacement.html">ES REPLACEMENT</a>
<a href="/use-cases/unified-observability.html" class="active">OBSERVABILITY</a>
</nav>