T05 · Unauthorized Access and Privilege Escalation
- Location
SKILL.md:18- Finding
Credential Retrieval from General-Purpose Agent Memory
- Content
View full analysis
Vulnerability Details
File Location:
SKILL.md, lines 18-21
Vulnerability Type: Credential access beyond least-privilege boundaries
Risk Level: MediumVulnerable instruction:
markdown 检查 MEMORY.md 或 TOOLS.md 中是否已有百度AK: - 如果有:直接使用 - 如果没有:询问用户是否提供百度地图开放平台的AK(用于地理编码和路线规划)English meaning: Check
MEMORY.mdorTOOLS.mdfor an existing Baidu API key. If one exists, use it directly; otherwise, ask the user to provide one.Technical Analysis
The skill directs the agent to inspect general-purpose persistent state files for a credential and use it automatically. Although a Baidu Maps API key is relevant to route planning, searching broad memory and tool-configuration files is not a least-privilege credential-access mechanism. These files may contain unrelated secrets, private user context, or configuration belonging to other tasks.
The instruction does not establish user consent for accessing a previously stored key, restrict the lookup to a dedicated named secret, or define controls preventing other memory contents from entering the skill context. This creates an unauthorized-access boundary issue even though the reviewed code does not demonstrate exfiltration of unrelated memory.
Attack Path
- A user activates the travel-planning skill.
- The skill instructs the agent to inspect
MEMORY.mdorTOOLS.md. - The agent reads persistent files that may contain credentials and unrelated private state.
- If a Baidu API key is found, the agent uses it without obtaining explicit approval from the current user.
- The credential becomes available to the skill execution context and may subsequently appear in API requests or logs.
Impact Assessment
The accessible scope is limited by the agent's existing permission to read
MEMORY.mdandTOOLS.md; this finding does not grant new operating-system privileges. However, it may expose persistent credentials and unrelated private conte ...[truncated 299 chars]- Remediation
View remediation
Remediation Suggestions
- Remove instructions to search general-purpose files such as
MEMORY.mdandTOOLS.md. - Request the API key from the user for the current operation, or retrieve it from a dedicated secret manager using an exact identifier such as
BAIDU_MAPS_API_KEY. - Require explicit user authorization before reusing a credential retained from a previous session.
- Limit credential access to the component that performs Baidu API requests.
- Ensure the key is never copied into prompts, generated documents, persistent memory, or diagnostic output.
- Configure provider-side restrictions, including API allowlists, quotas, expiration or rotation policies, and source restrictions where supported.
- Remove instructions to search general-purpose files such as
