Security: Bearer token sent over plaintext HTTP#418
Conversation
The hook scripts (stop.ts, post-tool-use.ts, etc.) send Bearer tokens in Authorization headers to REST_URL. When AGENTMEMORY_URL defaults to 'http://localhost:3111', tokens are transmitted over plaintext HTTP. While localhost traffic typically doesn't leave the machine, this could be intercepted by local malware or other processes on multi-tenant systems. Affected files: stop.ts Signed-off-by: tuanaiseo <221258316+tuanaiseo@users.noreply.github.com>
|
@tuanaiseo is attempting to deploy a commit to the rohitg00's projects Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR adds security validation to the agent memory startup sequence, ensuring that authentication secrets are never transmitted over insecure connections to remote endpoints. A new ChangesSecurity validation on startup
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 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)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
The hook scripts (stop.ts, post-tool-use.ts, etc.) send Bearer tokens in Authorization headers to REST_URL. When AGENTMEMORY_URL defaults to 'http://localhost:3111', tokens are transmitted over plaintext HTTP. While localhost traffic typically doesn't leave the machine, this could be intercepted by local malware or other processes on multi-tenant systems.
Severity:
highFile:
src/hooks/stop.tsSolution
Enforce HTTPS or validate that the URL uses https:// protocol. Consider adding a configuration check that errors if AGENTMEMORY_SECRET is set but AGENTMEMORY_URL uses http:// (non-loopback). The integrations/pi/security.ts already has a guard for this pattern - consider centralizing this logic.
Changes
src/hooks/stop.ts(modified)Testing
Summary by CodeRabbit