8000 Validate multibyte sequences in the fallback UTF-8 decoder by Aschenbath · Pull Request #166 · kawanet/msgpack-lite · GitHub
[go: up one dir, main page]

Skip to content

Validate multibyte sequences in the fallback UTF-8 decoder - #166

Open
Aschenbath wants to merge 1 commit into
kawanet:mainfrom
Aschenbath:fix/oss10-20261124-9130-msgpack-utf8-decode
Open

Aschenbath wants to merge 1 commit into
kawanet:mainfrom
Aschenbath:fix/oss10-20261124-9130-msgpack-utf8-decode

Conversation

@Aschenbath
Copy link
Copy Markdown
Contributor

The Array/Uint8Array UTF-8 decoder reads continuation bytes beyond a string payload and accepts invalid continuation bytes or out-of-range code points. A one-byte string containing a multibyte prefix can therefore decode differently depending on the following MessagePack field.

Bound each continuation read by the string end, validate byte ranges, and use U+FFFD for malformed sequences while leaving a non-continuation byte for the next iteration. Preserve the existing CESU-8 compatibility. Regressions cover truncated prefixes, invalid continuations, overlong sequences, out-of-range code points and valid boundaries. Ten malformed-input cases fail before the fix.

Validation on Node 24 / Windows: 214 Node tests and 200 Chromium tests passed; JSHint, minified bundle size/export checks and silent-import deprecation check passed.

This branch has not been deployed

No deployments
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.

1 participant

0