-
-
Notifications
You must be signed in to change notification settings - Fork 758
Closed
Labels
Description
Context
Follow-up from PR #56 (Story 6.19 - Post-install validator security hardening).
Issue
The repair() method in src/installer/post-install-validator.js currently checks isPathContained but misses TOCTOU (Time-of-check to time-of-use) symlink checks on the target path.
Required Fix
Before performing fs.copy in the repair method:
- Iterate path components of
targetPath(or walk fromthis.aiosCoreTargettopath.dirname(targetPath)) lstateach component to reject any symbolic links- Resolve
fs.realpathSync(targetPath)andfs.realpathSync(this.aiosCoreTarget) - Ensure the resolved target path remains contained within the resolved
aiosCoreTarget - If any symlink or realpath containment failure is detected, push a skipped/failed result and continue
Risk Assessment
- Severity: Low (edge case race condition)
- Attack vector: Requires local filesystem access during repair window
- Mitigation: Core validation path already has symlink protection
References
- PR Add security hardening for post-install validator with Ed25519 manifest signature verification #56 CodeRabbit review comment
- CWE-367: Time-of-check Time-of-use (TOCTOU) Race Condition
Labels
security, enhancement, good-first-issue
Reactions are currently unavailable