Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
📦 npm
Not in CISA KEV

GHSA-2r2p-4cgf-hv7h engramx

GHSA-2r2p-4cgf-hv7h is a security vulnerability in engramx. A fix is available for engramx — see the affected versions and patch details below.

engram: HTTP server CORS wildcard + auth-off-by-default enables CSRF graph exfiltration and persistent indirect prompt injection

Published
Apr 22, 2026
Updated
Apr 22, 2026
Affected
1 pkg
Patched
1 / 1
Exploits
None indexed
Exploitation data as of Apr 22, 2026 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected

How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.

0other npm packages depend on this — each one inherits the vulnerability until it's patched upstream
engramxnpm
118downloads / week

Description

Summary

The local HTTP server started by engram server (binding 127.0.0.1:7337 by default) was exposed to any browser origin with no authentication unless ENGRAM_API_TOKEN was explicitly set. Combined with Access-Control-Allow-Origin: * on every response and a body parser that did not require Content-Type: application/json, this allowed a malicious web page the developer visited to:

  1. Exfiltrate the local knowledge graph via GET /query and GET /stats (function names, file layout, recorded decisions/mistakes).
  2. Inject persistent prompt-injection payloads via POST /learn, which wrote mistake/decision nodes that were later surfaced as system-reminders to the user's AI coding agent on every future session and file edit.

Severity: High — confidentiality + persistent indirect prompt injection against the user's coding agent.

Affected versions

engramx >= 1.0.0, < 2.0.2 — any version that shipped the HTTP server.

Patched in

[email protected]

Workarounds (if you cannot upgrade)

  • Do not run engram server or engram ui.
  • If developers must, set ENGRAM_API_TOKEN to a long random value and terminate the server before browsing the web.

Remediation (applied in 2.0.2)

  1. Fail-closed auth on every non-public route — Bearer header or HttpOnly cookie, constant-time comparison, 256-bit auto-generated token at ~/.engram/http-server.token (0600).
  2. Wildcard CORS removed entirely; default is no CORS headers. Opt-in allowlist via ENGRAM_ALLOWED_ORIGINS.
  3. Host + Origin validation — rejects DNS rebinding and Host spoofing.
  4. Content-Type: application/json enforced on mutations — blocks the text/plain CSRF vector.
  5. /ui?token= bootstrap with Sec-Fetch-Site gate — prevents cross-origin oracle probing.

Credit

Discovered and responsibly disclosed by @gabiudrescu in engram issue #7.

Affected Packages

1 total 1 fixed
EcosystemPackageVulnerable rangeFix
📦npmengramxall versions2.0.2npm install engramx@2.0.2

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for engramx, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update engramx to 2.0.2 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-2r2p-4cgf-hv7h is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-2r2p-4cgf-hv7h can be triaged on real exposure rather than presence alone.

Tailored to GHSA-2r2p-4cgf-hv7h. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

### Summary The local HTTP server started by `engram server` (binding `127.0.0.1:7337` by default) was exposed to any browser origin with no authentication unless `ENGRAM_API_TOKEN` was explicitly set. Combined with `Access-Control-Allow-Origin: *` on every response and a body parser that did not require `Content-Type: application/json`, this allowed a malicious web page the developer visited to: 1. **Exfiltrate** the local knowledge graph via `GET /query` and `GET /stats` (function names, file layout, recorded decisions/mistakes). 2. **Inject persistent prompt-injection payloads** via `POST
O3 Security · Impact-Aware SCA

Is GHSA-2r2p-4cgf-hv7h in your dependencies?

O3 Security finds GHSA-2r2p-4cgf-hv7h across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.

GHSA-2r2p-4cgf-hv7h: engramx CSRF | O3 Security