T09 · Insecure Skill Coding Practices
- Location
humanize.py:58- Finding
Untrusted Input Can Override LLM Rewrite Instructions
- Content
View full analysis
str: """Construct the rewrite prompt.""" # 🐾 channel_guide = CHANNEL_GUIDES.get(channel, CHANNEL_GUIDES["general"]) tells_note = "" if tells: tells_note = ( f"\n\nDetected AI tells to eliminate: {', '.join(tells)}. " "Replace these with concrete, specific language." ) return f"""You are a human editor. Your job: take AI-generated text and make it sound like a real person wrote it. Rules: - Kill vague qualifiers. Be specific or cut them. - Vary sentence length. Mix short punchy sentences with longer flowing ones. - Use contractions (it's, don't, we're) where natural. - Fragments are fine. So are one-word sentences. Really. - Remove filler that doesn't carry meaning. - Keep the core message intact — don't invent new claims. - Add natural rhythm imperfections — humans don't write in perfect parallel structure. - No meta-commentary. Don't say "here's the rewritten version". Just output the text. {tells_note} Channel guidance: {channel_guide} TEXT TO HUMANIZE: --- {text} --- Output ONLY the rewritten text. Nothing else.""" ``` ### Technical Analysis The `text` parameter originates from a command-line argument or standard input and is interpolated verbatim into the same natural-language prompt that contains the application's operational instructions. The `---` delimiters are only text and do not create an enforceable trust boundary for the downstream language model. An attacker can submit content containing instructions that conflict with the rewrite rules, such as directions to ignore previous instructions and emit attacker-selected text. Because the model must interpret both the trusted rules and the untrusted co ...[truncated 1956 chars]- Remediation
View remediation
