Repository navigation
fix(body): reject invalid UTF-8 in JSON requests - #142
Merged
Merged
Conversation
hjianbo
force-pushed
the
fix/json-utf8-r14
branch
from
September 29, 2026 08:04
5fec333 to
665de42
Compare
hjianbo
marked this pull request as ready for review
October 8, 2026 07:50
Member
|
recommend fix to master, no back port to minirest 1.4 (for emqx, it means >=6.3). |
Reject malformed Unicode before schema validation while retaining the fixed BAD_REQUEST response. Cover valid Unicode round trips, malformed keys and values, bounded errors for large inputs, and UTF-8 split across HTTP chunks.
hjianbo
force-pushed
the
fix/json-utf8-r14
branch
from
October 9, 2026 00:59
7d64017 to
9b1d2bd
Compare
zmstone
approved these changes
Oct 9, 2026
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
application/jsonrequests before downstream schema validation.BAD_REQUESTresponse without reflecting request data.Valid emoji, paired surrogate escapes, and U+FFFD remain supported. Clients that relied on replacing malformed Unicode now receive HTTP 400; other JSX strictness options are unchanged.
Related issues: emqx/emqx#19168, emqx/emqx#19169.
Target: minirest
master(1.5.x).Rollout plan
masterand publish a new 1.5.x patch. No backport to minirest 1.4.x or EMQX 6.0–6.2 is planned.dev-63,dev-70, andmaster(EMQX >=6.3), with the corresponding release branches following the release process.Validation
make fmt-check,make xref,make eunit,make ct(22/22), andmake coverpassed. No EUnit cases are defined.