test: cover wrong JSON types in the MCP robustness layer - #1521
Conversation
The layer varies argument values but always sends the expected type. These nine send a value of the wrong JSON type for the request envelope fields parsed before tool dispatch: tool name, arguments, params and method. All nine pass against the current binary, so this is a regression guard for a class the layer does not currently reach, not a bug report. Signed-off-by: Mohak Gupta <mohakgupta0981@gmail.com>
|
Thanks for opening this — it has been seen, and it is queued. This note is automated, but it is not a brush-off: it exists so you know where your PR stands instead of having to guess from silence. Current review status: working through a backlog. What that means for this PR, concretely:
Things that will genuinely speed it up whenever review does happen:
If this fixes a bug, a reproduction we can run is worth more than a description of the symptom. Thanks for contributing, and sorry in advance for the wait. |
|
Thank you for the focused wrong-type robustness coverage. I have routed this as security-hardening test work for the immediate train with normal priority. The community review queue is currently full, so a complete maintainer review may take a little time, but the contribution is recorded and queued. |
The robustness layer varies argument values thoroughly (oversized, injection, negative, ReDoS) but always sends the expected type. These nine send a value of the wrong JSON type for the envelope fields parsed before tool dispatch:
name,arguments,params,method.All nine pass against the current binary. This is a regression guard for a class the layer does not currently reach, not a bug report — I went looking for a NULL deref and did not find one;
cbm_mcp_parse_requestrejects a non-stringmethodbefore use, andheap_strdupreturns NULL safely.Kept to the envelope. I also wrote per-tool field cases (wrong-typed
name_pattern,query,limit) and dropped them: they stop at project validation like the existing adversarial cases, so they added runtime without reaching new code.Layer goes 23/23 in 88s to 32/32 in 120s on this machine.