fix: stop forwarding client Authorization header to downstream apps#1042
fix: stop forwarding client Authorization header to downstream apps#1042b1ume wants to merge 1 commit into
Conversation
setHeaders was passing the incoming Authorization header straight through to the backend on every proxy request. If someone uses Basic Auth their creds end up forwarded. The Basic Auth passthrough from ACLs config still works.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe proxy controller no longer copies the incoming ChangesProxy header handling
Estimated code review effort: 1 (Trivial) | ~3 minutes Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
There was a problem hiding this comment.
Pull request overview
Stops leaking client-provided Authorization headers to downstream apps by removing automatic passthrough behavior in the proxy controller’s response-header handling.
Changes:
- Removed forwarding of the incoming request’s
Authorizationheader insetHeaders. - Kept configured Basic Auth passthrough behavior via ACLs (still explicitly sets its own
Authorizationresponse header when configured).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| func (controller *ProxyController) setHeaders(c *gin.Context, acls *model.App) { | ||
| c.Header("Authorization", c.Request.Header.Get("Authorization")) | ||
|
|
||
| if acls == nil { | ||
| return | ||
| } |
setHeaders was piping the client's Authorization header straight through to the downstream app on every request. if someone auths via Basic Auth their creds end up in the backend. even with session-based auth, any Authorization header the client sent gets leaked.
the configured Basic Auth passthrough from ACLs is untouched, it still sets its own header separately.
Summary by CodeRabbit