T01 · Skill Instruction Hijacking
- Location
references/monitor-full-patched.js:97- Finding
Untrusted Feishu document content is processed as an autonomous agent task
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is mostly transparent about automatic Feishu document collaboration, but it patches trusted OpenClaw code and lets shared document edits trigger authenticated agent actions with limited scoping.
Install only after reviewing the patch and limiting deployment to explicitly approved Feishu documents and Bitable bases. Use the narrowest OAuth scopes available, avoid exposing unrelated tools to the hook-triggered agent, add audit logging and approval gates for writes, and prefer a supported extension mechanism over replacing OpenClaw monitor code.
references/monitor-full-patched.js:97Untrusted Feishu document content is processed as an autonomous agent task
scripts/patch-monitor.sh:45Patch script replaces the installed Feishu monitor without version or integrity validation
references/monitor-full-patched.js:66Unbounded debounce map allows persistent memory growth
references/feishu-app-setup.md:25Setup guidance requests a broader Drive permission than the documented read-only scope
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
- The `name: "DocCollab"` field helps identify hook sessions in logs
- For .js files (openclaw-lark), no jiti cache clearing is needed
- For .ts files (older installs), clear jiti cache after patching:
`rm -f /tmp/jiti/src-monitor.*.cjs`
## Required Feishu App Permissions
Tool parameters are crafted to achieve unintended or unsafe behavior. Parameter abuse can bypass intended safety checks (e.g. shell=True, --force, dangerous glob patterns).
- The `name: "DocCollab"` field helps identify hook sessions in logs
- For .js files (openclaw-lark), no jiti cache clearing is needed
- For .ts files (older installs), clear jiti cache after patching:
`rm -f /tmp/jiti/src-monitor.*.cjs`
## Required Feishu App Permissions
The code embeds a natural-language prompt that instructs an agent to read a workspace file (DOC_PROTOCOL.md), fetch external document content, interpret it as conversation state, and conditionally write back to the document. This makes autonomous agent behavior depend on untrusted content and prompt instructions generated by an event bridge, which is a classic prompt-injection/enforced-agent-action risk that can lead to unauthorized reads, writes, or workflow manipulation.
The skill documents behavior that reads documents, makes network calls, reuses OAuth-backed access, and triggers hook sessions, but it declares no explicit tool scope or allowed-tools boundary. That mismatch weakens user and platform control over what the skill can access, increasing the risk of unintended document access, outbound requests, and privilege misuse.
The description promotes real-time collaboration but does not prominently warn that every qualifying edit can cause the agent to read document contents and append replies automatically. This is risky because users may expose sensitive business content without realizing that edits trigger automated processing and modification.
The trigger phrases are broad and include generic document-collaboration terms that could cause the skill to be suggested or activated in many ordinary editing contexts. In a skill that auto-reads and auto-modifies documents on edit events, overly broad triggering raises the chance of unintended invocation and surprise data processing.
The skill lists multiple powerful OAuth scopes and notes token reuse for isolated sessions, but it does not clearly warn that these credentials grant access to organizational documents and records. Without explicit sensitivity guidance, operators may over-provision scopes or deploy the skill without understanding the account-access and data-exposure implications.
The document is titled entirely in Chinese ("飞书文档对话协议") while the rest of the template is largely in English, indicating a locale-specific requirement without any user opt-in or explanation. This matches the policy concern for natural-language locale constraints that are imposed rather than offered as a choice.
The protocol explicitly instructs the AI to automatically open linked documents, process content, and update Bitable records, but it does not require any user-visible notice, confirmation, or approval before modifying shared artifacts. In a collaborative document/task system, this can cause unintended edits, silent workflow changes, and trust/confusion issues, especially when a linked document or task is triggered by another user or by malformed/unexpected content.
Suspicious Unicode normalization or mixed-script content
The manual patch explicitly registers a drive.file.bitable_record_changed_v1 handler in addition to document edit events, expanding the trigger surface beyond the stated document-collaboration use case. That broader event subscription can cause unintended monitoring or processing of spreadsheet/bitable changes, increasing data exposure and the chance of surprising autonomous agent execution.
The guide instructs users to manually modify installed extension files under user or system paths and clear runtime cache, but does not warn about integrity, persistence, upgrade breakage, or the security implications of patching production code. Manual source patching of installed components is risky because it bypasses normal package verification and makes it easy to introduce or conceal malicious behavior.
The document-edit handler reads a local OpenClaw config file from the host filesystem to extract a hooks bearer token, then uses that secret to invoke a separate localhost agent endpoint. This expands the skill from Feishu event handling into privileged local orchestration and secret consumption, creating a trust-boundary violation: untrusted document edits can indirectly trigger local agent actions using host-resident credentials.
The multi-step instruction block presents several benign-looking checks before authorizing a final feishu_update_doc action, which normalizes a pattern where the agent is expected to decide and perform writes based on document-controlled metadata. Even with gating rules, an attacker who can shape document content or protocol markers may steer the agent into taking unintended actions, especially because the validation is delegated to the agent rather than enforced in trusted code.
The script unconditionally replaces a core extension source file with a bundled reference file after creating a backup, without prompting the user or verifying that the replacement matches the installed extension version. This can silently alter system behavior, break the target integration, or introduce malicious logic if the skill package is tampered with, especially because it patches code in a user or system extension path.
The inline documentation labels this section as handling 'Document edit events' and notes that read events are intentionally ignored. However, the code also routes 'drive.file.bitable_record_changed_v1' into the same handler, which broadens behavior beyond document edits into Bitable task-board changes. This is a documentation-to-code divergence because the comment describes a narrower event scope than what is actually handled.
The comment on L136 is written in Chinese with no alternative language or indication that language choice is configurable. This can violate a language/locale policy when the skill is expected to be usable by broader teams without requiring a specific language.
Detected: suspicious.env_credential_access, suspicious.potential_exfiltration