Server error responses leak internal file paths to clients #29

Open
opened 2026-05-17 23:13:24 +02:00 by heiko · 1 comment
Owner

Summary

Several places in cmd/cert-proxy-server/serve.go pass raw Go OS errors directly to http.Error:

http.Error(w, err.Error(), http.StatusInternalServerError)

Go's os.Open errors include the full file path, e.g.:

open /var/lib/cert-proxy/certs/unknown.com/cert.pem: no such file or directory

This tells any client (including unauthenticated ones on public endpoints) the exact on-disk layout of the certbase.

Fix

Log the detailed error server-side and return a generic message to the client:

log.Printf("serving %s: %v", fn, err)
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
## Summary Several places in `cmd/cert-proxy-server/serve.go` pass raw Go OS errors directly to `http.Error`: ```go http.Error(w, err.Error(), http.StatusInternalServerError) ``` Go's `os.Open` errors include the full file path, e.g.: ``` open /var/lib/cert-proxy/certs/unknown.com/cert.pem: no such file or directory ``` This tells any client (including unauthenticated ones on public endpoints) the exact on-disk layout of the certbase. ## Fix Log the detailed error server-side and return a generic message to the client: ```go log.Printf("serving %s: %v", fn, err) http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) ```
Author
Owner

AI attribution comment added per repository instruction for this open issue.\n\n(co)authored by ai:gpt-5-codex

AI attribution comment added per repository instruction for this open issue.\n\n(co)authored by ai:gpt-5-codex
Sign in to join this conversation.
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
heiko/cert-proxy#29
No description provided.