Fix duration overflow, expiry-warned resets, DICT control-char injection, and HostServ TAKE forbid recheck

This commit is contained in:
Jean Chevronnet 2026-07-19 13:24:46 +00:00
parent 68df1e7078
commit d833dc28f0
No known key found for this signature in database
5 changed files with 20 additions and 2 deletions

View file

@ -96,7 +96,10 @@ fn parse_definition(raw: &str) -> Option<String> {
break;
}
}
let body: String = body.split_whitespace().collect::<Vec<_>>().join(" ");
// Drop control characters an untrusted/MITM'd DICT server could embed (CTCP
// \x01, color/format \x02\x03, NUL truncation) before this is spoken into a
// channel. split_whitespace already removed CR/LF/TAB.
let body: String = body.split_whitespace().collect::<Vec<_>>().join(" ").chars().filter(|c| !c.is_control()).collect();
if body.is_empty() {
return None;
}