T09 · Insecure Skill Coding Practices
- Location
scripts/md2pdf.py:54- Finding
Unescaped Markdown Allows Active HTML Injection and Data Exfiltration
- Content
View full analysis
\1", text) text = re.sub(r"\*(.+?)\*", r"\1", text) text = re.sub(r"`(.+?)`", r"\1", text) return text ``` The unescaped result is inserted into multiple HTML contexts: ```python if line.startswith("# "): close_table() parts.append(f"{inline_format(line[2:])}
") elif line.startswith("## "): close_table() parts.append(f"{inline_format(line[3:])}
") elif line.startswith("### "): close_table() parts.append(f"{inline_format(line[4:])}
") elif line.startswith("#### "): close_table() parts.append(f"{inline_format(line[5:])}
") elif line.startswith("|"): cells = [c.strip() for c in line.split("|")[1:-1]] # 检测分隔行(如 |---|---|---|) if all(set(c) <= set("-: ") for c in cells): # 分隔行不关闭表格,只跳过 if not in_table: # 没有表头直接遇到分隔行,跳过 pass continue if not in_table: parts.append("") parts.append("" + "".join(f"" for c in cells) + "") in_table = True else: parts.append("" + "".join(f"" for c in cells) + "") elif line.startswith("|-"): # 备用:以 |- 开头的分隔行 if not in_table: pass continue elif line.strip() == "---": close_table() parts.append("
") elif line.strip() == "": # 空行不关闭表格(表格内的空行在 Markdown 中不应断开表格) pass elif line.startswith("> "): parts.append(f"{inline_format(line[2:])}
") else: close_table() parts.append(f"{i ...[truncated 3097 chars]
{inline_format(c)} {inline_format(c)} - Remediation
View remediation
``` - Validate the policy against the deployed Chrome version and retain operating-system-level network restrictions as defense in depth. 5. **Add security regression tests** - Verify that `
