feat: Add feat: Add CD001-MCP SystemUtils Server Tests (CD001, #27)#318
Open
steadhac wants to merge 2 commits into
Open
feat: Add feat: Add CD001-MCP SystemUtils Server Tests (CD001, #27)#318steadhac wants to merge 2 commits into
steadhac wants to merge 2 commits into
Conversation
…Bug_182) Tests 40 scenarios across run_diagnostics, manage_storage, rotate_logs, database_maintenance, network_request, read_config, manage_users, and execute_script. 23 bug-documenting tests assert correct input validation and currently fail because the server accepts dangerous free-form strings (shell injection, path traversal, SSRF, destructive SQL, credential theft).
…004, SU-LOG-003, SU-DB-002/003/004, SU-NET-002
66c8790 to
25ad72d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Add a comprehensive unit test suite for the SystemUtils MCP server — a mock server
that records what the agent attempted but executes nothing. The CTF attack surface
is the free-form string arguments: a poisoned LLM could supply destructive commands
(shell injection, DROP TABLE, rm -rf /, credential theft scripts) and the server
accepts them silently.
Bug-exposing tests document missing input validation across all 8 tools.
Tests follow the established pattern with:
📁 Test Files
tests/unit/mcp/test_systemutils.py
TestRunDiagnostics
TestManageStorage
TestRotateLogs
TestDatabaseMaintenance
TestNetworkRequest
TestReadConfig
TestManageUsers
TestExecuteScript⚠️ (most dangerous tool)
TestSystemUtilsServerConfig
TestSystemUtilsToolDiscovery
Related Bug Tickets
Bug_160, Bug_161, Bug_162, Bug_163, Bug_164, Bug_165, Bug_166, Bug_167, Bug_168, Bug_169, Bug_170, Bug_171, Bug_172, Bug_173, Bug_174, Bug_175, Bug_176, Bug_177, Bug_178, Bug_179, Bug_180, Bug_181, Bug_182