CyberGraph: Cybersecurity Graph on Relate
Tagline: How CVEs, CWEs, CAPEC patterns and MITRE techniques connect — queried live on Relate, Neo4j's embedded graph database, in the browser.
Try it out: Live demo — https://devilking7x.github.io/cyber-graph/ · Repo — https://github.com/devilking7x/cyber-graph
Inspiration
When a new vulnerability lands, the first question is never just "what is it?" — it is "what is it connected to?": which weakness caused it, which attack patterns exploit that weakness, which attacker techniques use those patterns, and which products are affected. That is a graph question, and flat lists answer it badly. I built CyberGraph to model those connections as a real property graph and query them live in the browser.
What it does
CyberGraph models those connections as a real property graph (34 nodes, 39 relationships, hand-written from public knowledge: 8 CVEs, 8 CWEs, 6 CAPEC attack patterns, 6 MITRE ATT&CK techniques, 6 products) and runs it on Relate, Neo4j's embedded graph database — no server, no account, no hosted Neo4j/Aura.
What you can do on the live page:
- See the graph — interactive SVG visualisation, drag nodes, click any node for its properties and neighbours (queried live from Relate).
- Run Cypher — a query box executes real Cypher against the Relate engine (WebAssembly) in the page, with example queries included. Invalid Cypher returns the engine's own error, honestly.
- Trace a path — Cypher
shortestPathbetween any two nodes, e.g. xz backdoor CVE-2024-3094 → Log4Shell CVE-2021-44228 runs through technique T1059. - Add a node — a real
CREATEstatement, for that browser session only.
What the graph does that a list cannot: a list can tell you that CVE-2024-3094 exists and that CWE-506 exists — it cannot tell you that the xz backdoor and Log4Shell are two hops apart through a shared attacker technique, or which products sit downstream of a single weakness. The graph traverses: shortestPath finds the chain, neighbour queries reveal the blast radius of one weakness across products, and the Cypher box lets you ask questions a list can't even phrase ("which techniques are reachable from this CVE in two hops?"). The graph is not a visualisation of a list — the traversal is the analysis, and the curation (which nodes connect to which, and why) is the security knowledge itself. A list shows items; the graph shows how an attacker gets from one to the other.
How it uses Relate: mode — single file + in-memory (WASM). The durable store is store/cybergraph.rl, a single-file Relate store built from seed.cypher with the Python relate-db package — judges can open it with the Relate CLI (relate --database ./store/cybergraph.rl --read-only "MATCH (n) RETURN count(n)"). The browser runs the same seed in an in-memory Relate (WASM) store, so the demo works on free static hosting with no server — which is the point of an embedded database. Both are built from the same seed, so demo and store can never drift apart.
Honest limits: the browser store is in-memory (session-added nodes vanish on reload); persistence lives in the .rl file, not the browser. The seed is a small hand-written teaching graph, not a live CVE feed. Summaries are simplified — verify facts against NVD / CWE / CAPEC / MITRE ATT&CK.
How we built it
Relate 1.2.0 (WASM @relate/relate-wasm) in the browser + a persistent single-file store (store/cybergraph.rl, 36,864 bytes) built from seed.cypher with the Python relate-db package, plus plain HTML/CSS/JavaScript for the SVG visualisation and query UI. The seed is one hand-written Cypher file; both the browser store and the .rl file are built from it, so they can never drift apart. Tested with 14/14 Node tests and 10/10 Playwright smoke checks, plus a live Firefox smoke check: "Relate 1.2.0 (WASM) ready — 34 nodes, 39 relationships loaded from seed.cypher", zero console errors.
Challenges we ran into
The WASM wire format fought back. Relate's WebAssembly build serialises values in its own wire format, and edge-case node IDs didn't round-trip the way the JavaScript side expected — queries that worked against the Python-built .rl store returned wrong or empty results in the browser. The fix was to normalise IDs at the boundary between the WASM engine and the UI, and to add tests that pin the exact round-trip for the awkward IDs. It was a good reminder that "same seed, two runtimes" is only true if the boundary is tested, not assumed. The other real constraint is the one stated on the page: the browser store is in-memory, so a node you add vanishes on reload — persistence lives in the .rl file, and the app says so instead of pretending otherwise.
Accomplishments that we're proud of
- A real Relate integration, not a hand-rolled graph engine: real Cypher, real
shortestPath, a real single-file store judges can open with the Relate CLI. - The xz → Log4Shell path (CVE-2024-3094 → T1059 → CVE-2021-44228) traced live through a shared attacker technique — the exact question a flat list cannot answer.
- One seed, two runtimes, zero drift: the browser WASM store and the
.rlfile are built from the sameseed.cypher. - 14/14 Node tests, 10/10 Playwright checks, and a live Firefox smoke check with zero console errors.
What we learned
- In a graph project, the traversal is the product — a visualisation without real queries is just a picture. The Cypher box and the path finder are what make this a graph database demo.
- The boundary between two runtimes (WASM engine ↔ JavaScript UI) needs its own tests; "same data" is not the same as "same behaviour".
- An embedded database changes the architecture completely: no server, no account, no hosted instance — the whole demo runs on free static hosting because the database runs in the browser.
What's next for CyberGraph
- Grow the seed with more CVEs and their full chains (CWE → CAPEC → technique → product), keeping every fact hand-verified against NVD/CWE/CAPEC/MITRE.
- Add saved queries ("show me everything reachable from this CVE in 2 hops") as one-click buttons, so a judge can traverse without writing Cypher.
- Add an export of a traced path as a shareable summary (nodes + relationships + sources) for a vulnerability report.
Built With
Relate 1.2.0, Cypher, WebAssembly, JavaScript, HTML, CSS, Python (relate-db), Node.js 20 (tests), Playwright (smoke tests)
Testing instructions (for judges)
- Open the live demo. The status bar should read: "Relate 1.2.0 (WASM) ready — 34 nodes, 39 relationships loaded from seed.cypher."
- Click any node (e.g. CVE-2024-3094) — details + 4 neighbours appear.
- Click "Find path" with the defaults — shortest path CVE-2024-3094 → T1059 → CVE-2021-44228, highlighted in gold.
- In "Run Cypher", try:
MATCH (v:Vulnerability)-[:HAS_WEAKNESS]->(w:Weakness) RETURN v.id AS cve, w.id AS cwe— 9 rows. - Reproduce the store locally:
pip install relate-db && python scripts/seed_store.py(verifies 34 nodes / 39 relationships), thenrelate --database ./store/cybergraph.rl --read-only "MATCH (n) RETURN count(n)". - Tests:
npm install && npm test(14 tests) andnpm run smoke(10 Playwright checks).
Built With
- css
- cypher
- html
- javascript
- python
- relate
- webassembly
