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
MCP query_metrics accepts embedded NUL prefixes in time_group #24371
The MCP query_metrics handler reads time_group through json_object_get_string() and compares/parses the resulting C string. An embedded NUL therefore hides the suffix: "time_group": "max\u0000junk" reaches the same grouping selection as "max" when the other query arguments are valid.
Source trace checked against netdata/netdata @ b97c83c and PR #23281 head 6e5d82d:
src/web/mcp/mcp-tools-query-metrics.c: JSON string extraction and C-string comparisons in the grouping-validation block; grouping conversion later passes that same string to time_grouping_parse() (current lines 396-409 and 543-544).
Reproduction input: use any valid existing query_metrics request with time_group set to "max\u0000junk"; the encoded JSON string is longer than the method name accepted by the C-string parser. This report is based on the source trace, not a captured live-server response.
Expected: validate the complete JSON method identifier and return a structured parameter error for an embedded NUL. Add regression coverage for NUL before, inside and after a valid name, with an ordinary valid-name control. Check other enum parameters separately before expanding the scope.
Discovered while reviewing #23281 (review comment 4307885353). This is independent of that PR's expression/options contract and is not a merge dependency.
Activity