test(mcp-scan): pin per-finding HIGH severity so a downgrade can't silently disarm the gate (#4)#125
Merged
Merged
Conversation
…lently disarm the gate (#4) Beta feedback #4 (mutation finding): mcp-scan is the CI security gate — mcpScanCmd exits 1 iff a HIGH finding is present. Mutation testing showed that downgrading the `allow-shell` rule HIGH→MEDIUM SURVIVES the suite: the existing tests assert finding IDs + the aggregate `worst`, and the "flags shell access" case carries three co-occurring HIGH findings, so an allow-shell downgrade leaves `worst` still HIGH and goes unnoticed — the gate would silently stop blocking on shell access. Adds two mutation-killing tests: - allow-shell ALONE (clean default-deny policy + allowShell:true) is the SOLE non-info finding, so its severity is asserted directly (`high`), `worst` is `high`, and `mcpScanCmd` exits 1. Verified: this test FAILS when allow-shell is mutated to `medium` and PASSES on the real code. - each security-critical rule (no-policy, no-default-deny, wildcard-tool-perm) keeps its HIGH severity. Test-only; no behaviour change. Full create-agent-harness suite 363/363; tsc clean. Co-Authored-By: claude-flow <ruv@ruv.net>
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.
What / why
Closes a mutation-surfaced test gap from the AQE beta feedback (#4).
mcp-scanis the CI security gate —mcpScanCmdexits1iff a HIGH finding is present. Mutation testing showed theallow-shellHIGH→MEDIUM mutant survives: the tests assert finding IDs + the aggregateworst, and the "flags shell access" case has three co-occurring HIGH findings, so downgradingallow-shellleavesworststill HIGH and goes unnoticed — the gate would silently stop blocking on shell access.Change (test-only)
allow-shellALONE: a clean default-deny policy with onlyallowShell:true→allow-shellis the sole non-info finding, so its severity is asserted directly (high),worstishigh, andmcpScanCmdexits1. This can't hide behind another HIGH.no-policy,no-default-deny,wildcard-tool-perm) keeps its HIGH severity.Mutation-kill verified
Downgrading
allow-shelltomediuminmcp-scan.tsmakes the new test fail; it passes on the real code. (Verified locally, then reverted.)Tests
Full
create-agent-harnesssuite 363/363;tscclean. No behaviour change.🤖 Generated with claude-flow