Secure sandbox skill SSH config temp files - #5473
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughTwo internal helpers, ChangesTemp SSH Config Lifecycle Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Thanks for tackling this hardening. I opened #5517 for the full focused /tmp temp-file issue; it covers these skill-install SSH config writes via a shared mkdtemp-backed helper, and also covers the other TypeScript SSH config sites plus the targeted nemoclaw-start.sh /tmp writes. I think this PR is superseded by #5517 so we keep the security fix in one focused patch. If #5517 lands, this one can probably be closed. |
Summary
skill installandskill removewrote sandbox SSH configs directly under the shared temp directory using a name derived from the process id and current time. That made the path predictable enough for another local user to pre-create or race it.This change creates a private
mkdtempdirectory for each sandbox skill SSH config, writes the config file inside it with exclusive create mode and0600permissions, and removes the whole temp directory in cleanup.Validation
npm test -- src/lib/actions/sandbox/skill-install.test.tsnpx @biomejs/biome lint src/lib/actions/sandbox/skill-install.ts src/lib/actions/sandbox/skill-install.test.tsnpm run build:clinpm run typecheck:cliSummary by CodeRabbit