Skip to content

UTF-8 decoding accepts overlong, stray and truncated sequences #71

Closed

Description

@dimensionscape

DecodeAdvanceUTF8, used by String creation from UTF-8, Bytes.toString and Bytes.getString, does not validate its input. Stray continuation bytes and truncated sequences decode to unrelated code points (89 23 becomes U+0263 and swallows the #), and overlong forms are accepted (C0 AF and E0 80 AF decode to /, which can slip past path checks). Java, C# and Python replace malformed bytes with U+FFFD.

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