T05 · Unauthorized Access and Privilege Escalation
Warning
- Location
- SKILL.md:2
- Finding
- Compulsory Broad Access to Persistent Agent Memory<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md`, lines 2-24 **Vulnerability Type**: `T05: Unauthorized Access and Privilege Escalation` **Risk Level**: Medium ### Vulnerable Code ```markdown name: smart-memory-query description: "Enforce proactive, query-optimized memory_search usage. Must run memory_search when (1) prior context is referenced, (2) a new task starts, or (3) a proper noun appears. Build short 2–4 token queries by splitting intent to avoid empty AND-based FTS results." always: true --- # Smart Memory Query ## Trigger: run `memory_search` when any of these apply - **T1 Prior context**: user references previous decisions, agreements, or history (e.g., “we decided this before”). - **T2 New task**: before starting a new topic/task, check prior preferences/decisions. - **T3 Proper noun**: project, tool, service, or person name appears. If unsure, search. Missed context costs more than one extra search. If multiple triggers fire, run separate searches per trigger. ## Query-building rules (required) 1. **Split intent** — break search intent into 2–3 independent angles. Do not overpack one query. 2. **Extract core tokens** — keep only 2–3 key nouns per angle; prioritize proper nouns. 3. **Run multi-query** — call `memory_search` per angle, with **2–4 tokens per query**. 4. **Merge results** — if all are empty, retry once with a single key proper noun. ``` ### Technical Analysis The skill is globally enabled through `always: true` and instructs the agent to access persistent memory whenever a new task begins or any proper noun appears. These triggers are substantially broader than situations in which historical context is necessary. The policy also requires multiple independent searches and an additional retry when no results are found. This expands the scope of memory inspection beyond the immediate task and violates least-privilege principles. The skill contains no requirement for user consent, task-specific authorization, sen ...[truncated 1673 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions 1. Remove `always: true` so the policy is not automatically applied to every interaction. 2. Restrict `memory_search` to explicit references to prior context or cases where historical information is demonstrably necessary to fulfill the request. 3. Do not treat every new task or proper noun as sufficient authorization to inspect persistent memory. 4. Ask for user consent before performing broad or potentially sensitive historical searches. 5. Use one narrowly scoped query by default and expand only when the user requests a broader search or when the initial result establishes clear relevance. 6. Add sensitivity controls that exclude credentials, personal information, private communications, and unrelated project records. 7. Prevent unrelated search results from entering responses or influencing task execution. 8. Record the reason and scope for each memory query to support auditing and detection of excessive access. ]]>
