mirror of
https://github.com/block/buzz.git
synced 2026-08-18 06:50:31 +02:00
wire::classify normalized malformed JSON-RPC responses into well-formed allow results before the fail-closed broker could see them. A present non-string `method` collapsed to "no method" via `as_str`, and a frame with both `result` and `error` forwarded `result` unconditionally — so a `selected`/`allow_once` payload in either shape was laundered into an approval upstream of every authorization check. classify now forwards `result` only for a structurally valid response: no `method` member and exactly one of `result`/`error`. Any other shape normalizes to Null, which the broker denies. The adversarial-response tests attacked the result payload; these attack the frame structure. Co-authored-by: Will Pfleger <pfleger.will@gmail.com> Signed-off-by: Will Pfleger <pfleger.will@gmail.com>