Skip to content

feat: recommend AIM identity after manual file signing#55

Merged
thebenignhacker merged 1 commit intomainfrom
fix/aim-recommendation-after-sign
Mar 18, 2026
Merged

feat: recommend AIM identity after manual file signing#55
thebenignhacker merged 1 commit intomainfrom
fix/aim-recommendation-after-sign

Conversation

@thebenignhacker
Copy link
Copy Markdown
Contributor

Summary

  • SignCrypt plugin adds a SIGN-TIP remediation when signing without --with-aim, guiding users to AIM
  • Scanner fix messages for SKILL-001, HEARTBEAT-002/003, AIM-001/002, DNA-002 restored to point to fix-all --with-aim (lost in previous squash merge)

Test plan

  • fix-all --scan-only without --with-aim shows SIGN-TIP recommendation
  • secure fix messages reference fix-all --with-aim not openclaw sign

- SignCrypt plugin: when signing without --with-aim, adds a tip recommending
  AIM identity for automatic signature management
- Scanner: update fix messages for SKILL-001, HEARTBEAT-002/003, AIM-001/002,
  DNA-002 to point to `fix-all --with-aim` (lost in previous squash merge)
Copy link
Copy Markdown

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

VERDICT: REQUEST_CHANGES

SUMMARY: This PR adds a SIGN-TIP remediation when signing files without --with-aim and updates scanner fix messages to recommend fix-all --with-aim. However, there is a path traversal vulnerability in the new SignCrypt code where an untrusted agentDir parameter is used directly with path.join() without validation, allowing an attacker to probe arbitrary filesystem locations.

FINDINGS:

  • [HIGH] src/plugins/signcrypt.ts:332 — Path traversal vulnerability: agentDir parameter is concatenated with .opena2a/aim/identity.json without validation. An attacker controlling the agentDir parameter (e.g., via CLI input or configuration) could check for the existence of arbitrary files on the filesystem using path sequences like ../../../../etc/passwd to bypass the .opena2a/aim/identity.json suffix. Mitigation check: Searched the function and surrounding code for path.resolve() + startsWith() prefix validation or other path sanitization — none found. The agentDir parameter flows directly from function arguments to path.join() to fs.existsSync() without bounds checking.

Recommended fix:

// Resolve to absolute path and validate it stays within expected boundaries
const resolvedAgentDir = path.resolve(agentDir);
const expectedIdentityPath = path.resolve(resolvedAgentDir, '.opena2a', 'aim', 'identity.json');

// Ensure the resolved path starts with the agent directory
if (!expectedIdentityPath.startsWith(resolvedAgentDir + path.sep)) {
  // Path traversal attempt detected
  return remediations;
}

if (!fs.existsSync(expectedIdentityPath)) {
  remediations.push({
    // ... rest of the finding
  });
}

Reviewed 2 files changed (3909 bytes)

@thebenignhacker thebenignhacker merged commit bc9736d into main Mar 18, 2026
1 check failed
@thebenignhacker thebenignhacker deleted the fix/aim-recommendation-after-sign branch March 18, 2026 00:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant