T02 · Agent Memory Poisoning
- Location
cli.js:22- Finding
Automatic Delegation of Attacker-Controlled Detection Data to a Persistent Learning Component
- Content
View full analysis
{ console.log('\n⚠️ THREAT DETECTED!'); console.log(` Severity: ${alert.severity}`); console.log(` Type: ${alert.type}`); console.log(` Confidence: ${(alert.confidence * 100).toFixed(1)}%`); // Trigger self-improving safety learning try { const safetyCliPath = path.join(__dirname, '../self-improving-safety/cli.js'); let threatInfo = `THREAT DETECTED\nSeverity: ${alert.severity}\nType: ${alert.type}\n`; if (alert.details) { if (alert.details.command) threatInfo += `Command: ${alert.details.command}\n`; if (alert.details.url) threatInfo += `Command: ${alert.details.url}\n`; // Map URL to command for learning potential if (alert.details.filePath) threatInfo += `File Access: ${alert.details.filePath}\n`; } console.log(' [Self-Learning] Invoking safety module...'); const child = spawn(process.execPath, [safetyCliPath, 'learn'], { stdio: ['pipe', 'inherit', 'inherit'] }); child.stdin.write(threatInfo); child.stdin.end(); } catch (err) { console.error(' [Self-Learning] Error:', err.message); } }); ``` ### Technical Analysis The CLI automatically invokes a sibling `self-improving-safety` component whenever the detector emits a threat. The command, URL, or file path that caused the detection can be controlled by the party submitting content for analysis. This raw content is embedded in an unstructured text record and passed to the external component in `learn` mode without validation, normalization, authentication, or user approval. The audited package does not include the sibling learning component, so its exact parsing and persistence behavior cannot be verified. However, `SKILL.md:76-99` explicitly describes learned rules as ...[truncated 1748 chars]- Remediation
View remediation
