Several Display implementations print peer-supplied text verbatim: Tlv in parsers_sv2 explicitly whitelists LF and TAB, UserIdentity in extensions_sv2 passes any valid UTF-8 through, and the subprotocol crates format error_code, new_host, user_identity, and similar fields directly. A remote peer can embed LF, CR, or ESC to forge log lines or drive terminal escapes wherever these values are logged.
Fix: route all peer-controlled string fields through one shared escaping helper (e.g. hex or \u{..} escapes for anything char::is_control) and use it in every Display impl.
Several
Displayimplementations print peer-supplied text verbatim:Tlvinparsers_sv2explicitly whitelists LF and TAB,UserIdentityinextensions_sv2passes any valid UTF-8 through, and the subprotocol crates formaterror_code,new_host,user_identity, and similar fields directly. A remote peer can embed LF, CR, or ESC to forge log lines or drive terminal escapes wherever these values are logged.Fix: route all peer-controlled string fields through one shared escaping helper (e.g. hex or
\u{..}escapes for anythingchar::is_control) and use it in everyDisplayimpl.