You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Lone surrogates are not refused in MCP tool arguments or auth sign-up bodies (only core readBody paths refuse them) #1016
main at 21b4dfd (includes #996, "refuse lone surrogates at every JSON boundary"). Node 24, macOS.
Minimal reproduction
#996 made core's readBody refuse a lone UTF-16 surrogate with 400 invalid_unicode. Two JSON entry points do not go through readBody, so a lone surrogate is not refused there:
Auth sign-up (signUp: true). POST /api/auth/sign-up/email with "name":"\ud800Bob" answers 200. The stored name is EFBFBD 42 6F 62 (U+FFFD followed by "Bob"): silently replaced rather than refused. Better Auth parses its own body.
Expected: either both are refused like core's body reader, or the docs name the boundaries the refusal covers (core's body reader, the store) and say that MCP arguments and Better Auth bodies are not among them.
Relevant output
200 data: {"result":{"content":[{"type":"text","text":"{\"wellFormed\":false,\"codeUnit\":\"d800\"}"}] …
sign-up status 200 … "name":"�Bob"
stored name hex EFBFBD426F62 wellFormed true
Neither case lets a caller store a lone surrogate in the store. This is about consistency and docs, not security.
Activity
fix: refuse lone surrogates in MCP arguments, auth bodies, seeds and …