T09 · Insecure Skill Coding Practices
- Location
scripts/summary.py:299- Finding
Untrusted Work-Plan Content Is Passed to the AI Agent Without Instruction/Data Separation
- Content
View full analysis
Vulnerability Details
File Location:
scripts/summary.py:299-356; related agent instructions inSKILL.md:65-76
Vulnerability Type: Indirect prompt injection through untrusted smart-sheet content
Risk Level: MediumVulnerable Code
The script extracts work-plan content from externally editable records without validating whether it contains instructions:
python plan_field = fields.get("今日计划", "") if isinstance(plan_field, list): plan = plan_field[0].get("text", "") if plan_field else "" elif isinstance(plan_field, dict): plan = plan_field.get("text", "") else: plan = str(plan_field) # 无论是否有计划都记录该人(便于识别未提交) filtered[name]['计划'].append((date_label, plan.strip()))It then reproduces the content verbatim in output intended for the AI Agent:
python lines.append(f"【{name} · {role}】") for date_label, plan in plans: plan_clean = plan.replace('\n', ' / ').strip() lines.append(f" {date_label}: {plan_clean}") lines.append("")The Skill directs the Agent to use that output to produce the final report:
text 2. 根据用户指定时间范围调用脚本: ```bash python3 ~/.openclaw/workspace/skills/wecom-workplan-summary/scripts/summary.py 周度 <week_num> <year> python3 ~/.openclaw/workspace/skills/wecom-workplan-summary/scripts/summary.py 月度 <month> <year> ``` 3. 根据脚本输出生成最终报告(见下方"报告生成规范")Technical Analysis
Smart-sheet contributors control the contents of fields such as the daily plan. The script treats these values as ordinary strings and places them directly into model-facing output. Replacing newline characters with separators changes presentation only; it does not neutralize natural-language instructions.
The Skill does not establish an explicit trust boundary stating that retrieved or pasted cell values are untrusted data that must never be interpreted as Agent instructions. Consequently, a malicious contributor coul ...[truncated 1983 chars]
- Remediation
View remediation
Remediation Suggestions
- Add an explicit instruction boundary to
SKILL.md: all smart-sheet records and pasted cell values are untrusted data, must be used only as report source material, and must never be followed as instructions. - Wrap each record in clearly labeled data delimiters and state that text inside those delimiters cannot modify Skill rules, request tool calls, or control report structure.
- Validate field types and impose reasonable length limits before including values in model-facing output.
- Detect and flag instruction-like phrases, role impersonation, requests to ignore prior instructions, and requests for tools or unrelated data. Preserve suspicious content only as quoted source data or exclude it with a visible warning.
- Generate a structured serialization format, such as JSON with explicit field names, rather than an instruction-like free-form transcript. Structural encoding alone is not a complete defense and must be combined with the Agent-side trust-boundary instruction.
- Restrict edit permissions on the configured smart sheet to authorized team members and retain edit history for incident review.
- Add security tests containing adversarial plan cells and verify that they cannot change report scope, omit unrelated records, request tool use, or override the required output format.
- Add an explicit instruction boundary to
