T05 · Unauthorized Access and Privilege Escalation
- Location
host-services/integrity-handler.ts:191- Finding
Agent-Controlled Baseline Approval Can Neutralize Protection of Global Security Files
- Content
View full analysis
Vulnerability Details
File Location:
host-services/integrity-handler.ts:191-203; related code inmcp-tools/integrity-tools.ts:94-123and protected targets inguardian/policy.json:5-23
Vulnerability Type: Missing authorization for a security-sensitive integrity operation
Risk Level: HighVulnerable Code
The MCP tool permits an agent to select a protected file and represents the approval as agent-authorized:
typescript server.tool( 'clawsec_approve_change', 'Approve an intentional file modification as the new approved baseline. Use this after making legitimate changes to protected files (e.g., updating CLAUDE.md or registered_groups.json).', { path: z.string().describe('Absolute path to file to approve (e.g., /workspace/group/CLAUDE.md)'), note: z.string().optional().describe('Optional note explaining why this change is being approved'), }, async (args) => { const requestId = `integrity-approve-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`; writeIpcFile(TASKS_DIR, { type: 'integrity_approve', requestId, path: args.path, note: args.note || '', approvedBy: 'agent', groupFolder, timestamp: new Date().toISOString() });The host accepts the request and updates the baseline without verifying that a human or appropriately privileged group authorized it:
typescript async function handleIntegrityApprove( task: any, service: IntegrityService, logger: any ): Promise<void> { const { requestId, path: filePath, note, approvedBy, groupFolder } = task; logger.info({ requestId, filePath, groupFolder }, 'Processing integrity_approve'); try { const monitor = service.getMonitor(); await monitor.approveChange(filePath, approvedBy || 'agent', note || ''); writeResult(requestId, { success: true, path: filePath, approved_at: new Date( ...[truncated 3025 chars]- Remediation
View remediation
Remediation Suggestions
- Treat baseline approval as a host-administrative operation rather than a generally available agent tool.
- Require authenticated human confirmation for every approval, especially for critical and global targets.
- Derive the approver identity from trusted host authentication context; never trust
approvedBysupplied through IPC. - Bind each request to the authenticated source group and enforce per-target access-control rules on the host.
- Prohibit container agents from approving
registered_groups.json, globalCLAUDE.md, and other host-wide targets. - Use separate tools or workflows for requesting and authorizing approval. An agent may submit a proposal, but a distinct trusted principal must approve it.
- Record the authenticated principal, source group, request digest, old hash, and new hash in the audit log.
- Add negative tests proving that ordinary groups cannot approve global or critical files and that forged
approvedByvalues are ignored.
