Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .jules/sentinel.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,7 @@
**Vulnerability:** Lack of security headers (`Content-Security-Policy`, `X-Content-Type-Options`, `X-Frame-Options`, `Strict-Transport-Security`)
**Learning:** `http.Serve` does not implement standard security headers natively.
**Prevention:** Always wrap `http.ServeMux` or route handlers with an HTTP middleware that adds essential security headers.
## 2025-04-25 - Enhance Security Headers
**Vulnerability:** Missing strict Referrer-Policy header.
**Learning:** While the app has basic security headers (CSP, X-Content-Type-Options, etc.), adding `Referrer-Policy: strict-origin-when-cross-origin` helps prevent leaking potentially sensitive URL information to external domains when cross-origin links are clicked.
**Prevention:** Include a comprehensive set of security headers for all web endpoints as a standard defense-in-depth practice.
1 change: 1 addition & 0 deletions internal/server/http_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ func withSecurityHeaders(next http.Handler) http.Handler {
w.Header().Set("X-Content-Type-Options", "nosniff")
w.Header().Set("X-Frame-Options", "DENY")
w.Header().Set("Strict-Transport-Security", "max-age=63072000; includeSubDomains")
w.Header().Set("Referrer-Policy", "strict-origin-when-cross-origin")
next.ServeHTTP(w, r)
})
}
Expand Down
Loading