MCP07
- Location
plugin/tools/guardrail_check.ts:196- Finding
Guardrail Check Exposes Private Protection Rules to Public Sessions ## Remediation Suggestions 1. Resolve the caller’s effective access level using `toolCallAccessLevel(cfg.accessLevel, toolCallId)`. 2. Apply visibility restrictions before exposing any rule-derived text, paths, or identifiers. 3. Separate internal enforcement from disclosure. If enforcement must evaluate private rules, return a generic block response to unauthorized callers rather than the private matched-rule payload. 4. Apply equivalent authorization to override handling and any other interface that exposes rule metadata. 5. Add tests covering public, trusted, private, unbound, and expired-session calls. Include a root-targeting probe and verify that private rule information never reaches a lower-trust response.
- Content
View full analysis
Vulnerability Details
File Location:
plugin/tools/guardrail_check.ts:167–185— constructs results containing protected rule data.plugin/tools/guardrail_check.ts:196–225— loads rules without access-level restrictions.plugin/tools/guardrail_check.ts:351–368— executes without resolving the caller’s session authorization.
Vulnerability Type: Missing Authorization / Information Disclosure (CWE-862)
Risk Level: Medium
Confidence: HighVulnerable Code
The rule query restricts category but not visibility:
ts const points = await qdrantClient.scrollFiltered( { must: [{ key: "category", match: { value: "rule" } }] }, 200, )Matched results include private rule text, paths, and identifiers:
ts function collectMatches( targets: string[], rules: ProtectionRule[], action: string, ): Array<Record<string, unknown>> { const matched: Array<Record<string, unknown>> = [] for (const target of targets) { for (const rule of rules) { if (pathMatches(target, rule.path)) { matched.push({ target, protected_path: rule.path, rule_text: rule.ruleText, source_memory_id: rule.sourceId, action, }) } } } return matched }The tool handler ignores the tool-call identity and directly returns the evaluation:
ts async execute( _toolCallId: string, params: { command: string; tool_name?: string; tool_input?: Record<string, unknown> }, ) { const { command, tool_name: checkedToolName = "", tool_input: toolInput = {} } = params const result = await evaluateGuardrail( qdrantClient, cfg, checkedToolName, command, toolInput, ) return { content: [{ type: "text" as const, text: JSON.stringify(result) }] } },Technical Analysis
Other memory tools resolve a session-bound access level before exposing stored memories.
nexus_guardrail_checkdoes not apply that authorization mechanism:_toolCallIdis ig ...[truncated 2086 chars]
