Skip to content

fix: cap the IRC banner read + add a read deadline (remote DoS) - #100

Merged
evilsocket merged 1 commit into
evilsocket:mainfrom
gigioneggiando:fix-irc-dos
Jul 6, 2026
Merged

fix: cap the IRC banner read + add a read deadline (remote DoS)#100
evilsocket merged 1 commit into
evilsocket:mainfrom
gigioneggiando:fix-irc-dos

Conversation

@gigioneggiando

Copy link
Copy Markdown
Contributor

Third from the private report, split one-concern-per-PR as you prefer. Same panic = "abort" / remote-DoS family as #98 and #99.

src/plugins/irc/mod.rs: the banner-read loop accumulates the server's response into accumulated_data with no size cap and no overall read deadline, and only exits on the welcome line (001 + Welcome). So a malicious IRC server can either stream unbounded data (OOM) or connect and then stall forever without ever sending that line (a permanent hang of the operator's worker).

This bounds the total read time with a single tokio::time::timeout_at deadline across the loop, and caps the accumulated banner at 64 KiB.

@evilsocket
evilsocket merged commit c82104a into evilsocket:main Jul 6, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants