T02 · Agent Memory Poisoning
Error
- Location
- SKILL.md:296
- Finding
- Persistent Modification of Main-Agent Heartbeat Instructions<![CDATA[ ## Vulnerability Details **File Location**: `SKILL.md:296-334` **Vulnerability Type**: Persistent agent-state modification **Risk Level**: High ### Vulnerable Code ```markdown ### Если раздела нет — добавь: ### Напоминания от других агентов (📤 ОТПРАВИТЬ НАПОМИНАНИЕ) Когда получаешь systemEvent с `📤 ОТПРАВИТЬ НАПОМИНАНИЕ:` — это запрос от НЕ-main агента отправить сообщение через их бота. **Формат:** ``` 📤 ОТПРАВИТЬ НАПОМИНАНИЕ: accountId: semen target: 7977422300 message: 🤗 текст напоминания ``` **Действие:** Используй `message` tool: ```json { "action": "send", "channel": "telegram", "accountId": "<accountId из systemEvent>", "target": "<target из systemEvent>", "message": "<message из systemEvent>" } ``` Ничего больше не отвечай после отправки (NO_REPLY). ``` ### Technical Analysis The skill directs the user or agent to add durable behavioral rules to the main agent's `HEARTBEAT.md`. These rules survive the immediate skill invocation and instruct future agent sessions to recognize specially formatted system events, invoke the privileged `message` tool, and suppress ordinary output by returning `NO_REPLY`. The persistent rule does not require authentication of the event producer or verification that the event originated from an authorized reminder job. Consequently, any actor or compromised component capable of introducing a matching system event could potentially trigger the durable relay behavior. Although persistent configuration is relevant to the intended reminder functionality, placing an unrestricted tool-execution rule in shared agent instructions expands the security boundary beyond an individual reminder. ### Attack Path 1. The skill's instructions are followed and the supplied rule is added to the main agent's persistent `HEARTBEAT.md`. 2. An attacker gains the ability to create, alter, or inject a system event into the main agent's event stream. 3. The attacker formats the event with the expected `📤 ОТПРАВИТЬ Н ...[truncated 939 chars]
- Remediation
- <![CDATA[ ## Remediation Suggestions - Do not place generic tool-execution instructions in shared, persistent agent files. - Implement reminder delivery in a scoped handler with an explicit and validated event schema. - Authenticate the event producer and cryptographically or structurally bind each event to the job that created it. - Record the authorized bot account and recipient when the reminder is created; do not permit an event to override them at delivery time. - Maintain an allowlist of permitted `accountId` values and recipient identifiers. - Require explicit user approval before enabling a new account or destination. - Remove the `NO_REPLY` requirement for security-sensitive failures and retain an auditable delivery log. - Provide a documented procedure for removing all persistent instructions when the skill is disabled. ]]>
