Executive brief
usage_rules is an Elixir library that provides documentation search functionality through the mix build tool. A malicious package publisher can inject ANSI terminal escape sequences into their package's documentation metadata, allowing them to manipulate terminal output when developers search documentation—such as forging URLs, hiding text, or stealing clipboard data without requiring any special access or authentication.
Technical details
The vulnerability is an Improper Neutralization of Escape, Meta, or Control Sequences (CWE-150) in the Mix.Tasks.UsageRules.SearchDocs formatter. The vulnerable component searches and displays Hex documentation indexed from every published package, but fails to sanitize ANSI terminal control characters in publisher-controlled fields (package name, documentation title, snippets, URLs). An attacker can publish a malicious package with embedded escape sequences (cursor movement, line erase, carriage return, OSC 52 clipboard writes) in its indexed documentation. When a developer runs mix usage_rules.search_docs and the malicious package appears in results, the sequences execute on the developer's terminal unchanged, enabling visual forgery or clipboard hijacking. The attack requires only the ability to publish a package to Hex—no authentication bypass or privileged position. Patches are available in version 1.2.8 and later.
Affected products
- ash-project usage_rules 0.1.18 to before 1.2.8
Timeline
- 2026-09-08: disclosed: CVE-2026-82710 published