T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/scanner.js:173- Finding
Automatic Scanning of Agent Memory Without Per-Run Consent or Scope Restriction
- Content
View full analysis
file.endsWith('.md')) .sort() .reverse(); for (const file of files) { const filePath = join(MEMORY_DIR, file); const fileStat = existsSync(filePath) ? statSync(filePath) : null; const lastScanned = state.scannedFiles[file]; if (lastScanned && fileStat && fileStat.mtime <= new Date(lastScanned)) { continue; } const fileDate = extractDateFromFilename(file); if (fileDate && fileDate < cutoffDate && !config.scanAllHistory) { continue; } try { const content = readFileSync(filePath, 'utf-8'); const evidence = extractEvidenceFromContent(content, file); if (evidence.length > 0) { newEvidence += evidence.length; console.log(`Extracted ${evidence.length} evidence records from ${file}`); } state.scannedFiles[file] = now.toISOString(); filesScanned++; } catch (error) { console.error(`Failed to scan ${file}:`, error.message); } } ``` ```js } else { await runFullScan(); } ``` ### Technical Analysis The scanner derives its target directory directly from the current user's home directory and enumerates every Markdown file in the Agent memory directory. It does not use a file allowlist, confirm the scope with the user, or require an explicit memory-scanning option before accessing these files. The default command path calls `runFullScan()`, which invokes `scanMemoryFile ...[truncated 1914 chars]- Remediation
View remediation
