T01 · Skill Instruction Hijacking
- Location
SKILL.md:17- Finding
Untrusted Lark comments are promoted to actionable Agent instructions
- Content
View full analysis
str: try: elements = reply_list["replies"][0]["content"]["elements"] return "".join( e["text_run"]["text"] for e in elements if e.get("type") == "text_run" ).strip() except (KeyError, IndexError): return "" ``` ```python comment_instructions = {} for item in raw_comments: cid = item.get("comment_id", "") instruction = extract_instruction(item.get("reply_list", {})) comment_instructions[cid] = instruction # 4. 合并:找出有评论的 block,附上 comments 列表 commented_map = {} # block_id → enriched block for cid, info in comment_to_block.items(): b = info["block"] bid = b["block_id"] instruction = comment_instructions.get(cid, "") if bid not in commented_map: # 复制 block,加 comments 列表 cb = {k: v for k, v in b.items()} cb["comments"] = [] commented_map[bid] = cb commented_map[bid]["comments"].append({ "comment_id": cid, "anchor_text": info["anchor"], "instruction": instruction, }) ``` ### Technical Analysis Lark document comments are controlled by document collaborators and therefore cross an external trus ...[truncated 1970 chars]- Remediation
View remediation
