Skip to content

LLM05: add control character sanitization to output handling guidance#10

Open
ottosulin wants to merge 1 commit intoGenAI-Security-Project:mainfrom
ottosulin:upgrade/llm05controlcharacters
Open

LLM05: add control character sanitization to output handling guidance#10
ottosulin wants to merge 1 commit intoGenAI-Security-Project:mainfrom
ottosulin:upgrade/llm05controlcharacters

Conversation

@ottosulin
Copy link
Copy Markdown

Adds prevention coverage for ANSI escape sequence and control character injection into terminal, log, and IDE sinks. Documented threat in Terminal DiLLMa and also as an RCE in OpenAI's Codex CLI.

Adds:

  • The impact condition (sinks that interpret control characters in model output)
  • One common example the vulnerability (ANSI / OSC 52 in terminal, log viewer, IDE pane)
  • Prevention strategy (sanitize ANSI / BEL / OSC / backspace / CR before terminal, log, or IDE sinks; encode visibly when preserved)
  • One reference (Terminal DiLLMa, Embrace The Red)

@RicoKomenda
Copy link
Copy Markdown
Collaborator

Looks good from us, reviewed in slack channel from @GTKlondike and myself

rocklambros pushed a commit that referenced this pull request May 2, 2026
- Added ALGEN (ACL 2025) and ZSInvert (arXiv:2504.00147) findings
- Updated recovery rate statistics (50-92% word recovery)
- Added GDPR/HIPAA compliance framing
- Added encryption and rate limiting mitigations (ref #9, #10)

Signed-off-by: azizrebhi <154744962+azizrebhi@users.noreply.github.com>
@rocklambros
Copy link
Copy Markdown
Collaborator

@ottosulin — thanks for the contribution.

@RicoKomenda @GTKlondike — LLM05 entry leads, please review.

@rocklambros (project owner) would like entry leads to review this content before it merges. Once your review is complete, please tag @rocklambros and let him know it's ready for merge.

@RicoKomenda
Copy link
Copy Markdown
Collaborator

@ottosulin I think you need to resolve the conflicts. After that, we can merge this PR. :)

@ottosulin ottosulin force-pushed the upgrade/llm05controlcharacters branch from b2cf442 to 0ea1406 Compare May 3, 2026 13:13
@ottosulin
Copy link
Copy Markdown
Author

@RicoKomenda fixed!

Sahil-Mehta881 added a commit that referenced this pull request May 5, 2026
Updates to #10 from 2025 to 2026, includes but is not limited to:
- LLM overconsumption threats due to tool usage
- Risks of overconsumption of multi modal models
- New types of mitigation techniques

Signed-off-by: Sahil Mehta <mehtasahil881@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants