T09 · Insecure Skill Coding Practices
- Location
scripts/init_research_area_review_skill.py:82- Finding
Untrusted Profile Data Is Embedded into Generated Skill Instructions and YAML Configuration
- Content
View full analysis
str: area_name = spec.get("area_name") or skill_name scope = spec.get("one_sentence_scope") or "not reported" description = ( f"Review papers in the research area '{area_name}' using a custom area profile, " "OpenReview-derived reviewer concern patterns, subtle logic flaw checks, " "and rebuttal/revision planning. Use for papers in this field/problem family." ) return f"""--- name: {skill_name} description: {description} license: MIT-0 --- # {area_name} Reviewer OpenReview Use this area-specific skill to review papers in this research field or problem family. Scope: {scope} ``` ```python write( skill_dir / "agents" / "openai.yaml", "interface:\n" f" display_name: \"{spec.get('area_name', skill_name)} Reviewer\"\n" " short_description: \"Custom OpenReview-grounded area review skill.\"\n" f" default_prompt: \"Use ${skill_name} to review this paper in the target research area.\"\n", ) ``` ### Technical Analysis The generator reads an arbitrary JSON profile and interpolates fields such as `area_name` and `one_sentence_scope` directly into generated Markdown, YAML front matter, and `agents/openai.yaml`. These values are not restricted to single-line scalar data and are not escaped using a YAML-aware serializer. An attacker-controlled value can therefore contain: - newline characters; - additional YAML keys; - quotation marks that terminate the intended YAML scalar; - Markdown headings or directives; - instructions intended to alter the behavior of an Agent loading the generated Skill. For example, a crafted `area_name` could close the `display_name` value and introduce ...[truncated 2053 chars]- Remediation
View remediation
