Summary
engram: HTTP server CORS wildcard + auth-off-by-default enables CSRF graph exfiltration and persistent indirect prompt injection
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:
- Exfiltrate the local knowledge graph via
GET /queryandGET /stats(function names, file layout, recorded decisions/mistakes). - Inject persistent prompt-injection payloads via
POST /learn, which wrotemistake/decisionnodes 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
Workarounds (if you cannot upgrade)
- Do not run
engram serverorengram ui. - If developers must, set
ENGRAM_API_TOKENto a long random value and terminate the server before browsing the web.
Remediation (applied in 2.0.2)
- 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). - Wildcard CORS removed entirely; default is no CORS headers. Opt-in allowlist via
ENGRAM_ALLOWED_ORIGINS. - Host + Origin validation, rejects DNS rebinding and Host spoofing.
Content-Type: application/jsonenforced on mutations, blocks the text/plain CSRF vector./ui?token=bootstrap withSec-Fetch-Sitegate, prevents cross-origin oracle probing.
Credit
Discovered and responsibly disclosed by @gabiudrescu in engram issue #7.
Impact
A critical operation is accessible without requiring any authentication. Typical impact: any user can invoke the privileged function.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
Frequently Asked Questions
- What is GHSA-2R2P-4CGF-HV7H? GHSA-2R2P-4CGF-HV7H is a high-severity missing authentication for critical function vulnerability in engramx (npm), affecting versions < 2.0.2. It is fixed in 2.0.2. A critical operation is accessible without requiring any authentication.
- Which versions of engramx are affected by GHSA-2R2P-4CGF-HV7H? engramx (npm) versions < 2.0.2 is affected.
- Is there a fix for GHSA-2R2P-4CGF-HV7H? Yes. GHSA-2R2P-4CGF-HV7H is fixed in 2.0.2. Upgrade to this version or later.
- Is GHSA-2R2P-4CGF-HV7H exploitable, and should I be worried? Whether GHSA-2R2P-4CGF-HV7H is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether GHSA-2R2P-4CGF-HV7H is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix GHSA-2R2P-4CGF-HV7H? Upgrade
engramxto 2.0.2 or later.