Skip to content

test: cover wrong JSON types in the MCP robustness layer - #1521

Open
lukiod wants to merge 1 commit into
DeusData:mainfrom
lukiod:test/mcp-fuzz-wrong-types
Open

test: cover wrong JSON types in the MCP robustness layer#1521
lukiod wants to merge 1 commit into
DeusData:mainfrom
lukiod:test/mcp-fuzz-wrong-types

Conversation

@lukiod

@lukiod lukiod commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

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_request rejects a non-string method before use, and heap_strdup returns 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.

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>
@lukiod
lukiod requested a review from DeusData as a code owner August 10, 2026 17:47
@github-actions

Copy link
Copy Markdown

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. 0.9.1-rc.1 is out, so the release freeze that held reviews is over — but it left a large queue of open pull requests behind it, and we are reading through them oldest-first. The background is in discussion #1144.

What that means for this PR, concretely:

  • It will not be closed for inactivity. No stale bot touches pull requests here.
  • It may still sit a while before a human reads it. That is on us, not on you.
  • Older PRs are read first, so a recent one is not being skipped — it is behind a queue.

Things that will genuinely speed it up whenever review does happen:

  • Keep it rebased on main — the tree is moving quickly right now, and a conflicting branch cannot be reviewed as the diff you intended.
  • Get CI green, or say which failures you believe are pre-existing.
  • Keep the change to one claim. Bundled features and refactors get split before they get merged, which costs you a round trip.
  • Every commit needs a sign-off (git commit -s) — CI enforces DCO.

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.

@DeusData DeusData added the security Security vulnerabilities, hardening label Aug 10, 2026
@DeusData DeusData added this to the 0.10.0-rc milestone Aug 10, 2026
@DeusData DeusData added the priority/normal Standard review queue; useful PR with ordinary maintainer urgency. label Aug 10, 2026
@DeusData

Copy link
Copy Markdown
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority/normal Standard review queue; useful PR with ordinary maintainer urgency. security Security vulnerabilities, hardening

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants