Repository navigation
Conversation
This adds a fallback SetWriteDeadline to the HTTP server for all paths, including CORS preflights and zero-delay responses, preventing a slowloris-style denial of service. Co-authored-by: tejjasdev <213147578+tejjasdev@users.noreply.github.com>
|
π Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a π emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
π¨ Severity: MEDIUM
π‘ Vulnerability: The HTTP server omitted a global
WriteTimeout(to support configurable dynamic delays) but only set aWriteDeadlineper request ifDelay > 0. This allowed malicious clients to slowly read responses with zero delay, or CORS preflights, holding connections open indefinitely (Slowloris attack).π― Impact: A malicious actor could exhaust server resources and block other connections by initiating requests and reading the responses extremely slowly.
π§ Fix: Updated the server handler to unconditionally apply
SetWriteDeadlineusinghttp.NewResponseController. The timeout isDelay + 30*time.Secondfor regular responses, and30*time.Secondfor CORS preflights.β Verification: Ran
make check(tests passing) and manually tested withgo rundummy servers simulating the fix.Journal entry added to
.jules/sentinel.md.PR created automatically by Jules for task 9883747077420911889 started by @tejjasdev