Upstream response headers forwarded verbatim (request smuggling) #5

Open
opened 2026-05-18 02:18:40 +00:00 by renekv · 0 comments
Contributor

Severity: High

proxyChatCompletions at cmd/ocgo/main.go:431-433 blindly copies all upstream response headers to the client via copyHeaders(). If the upstream (opencode.ai) were ever compromised or misconfigured, this enables HTTP response splitting and header injection.

Fix: Only forward specific allowlisted headers (e.g. Content-Type) and strip all others.

**Severity: High** `proxyChatCompletions` at `cmd/ocgo/main.go:431-433` blindly copies all upstream response headers to the client via `copyHeaders()`. If the upstream (`opencode.ai`) were ever compromised or misconfigured, this enables HTTP response splitting and header injection. **Fix:** Only forward specific allowlisted headers (e.g. `Content-Type`) and strip all others.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: opencode/ocgo#5
No description provided.