Skip to content

Message Display impls render peer-controlled strings without escaping control characters #2358

Description

@bit-aloo

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions