Am I affected?

type your usage_rules version to check

Description

Improper Neutralization of Escape, Meta, or Control Sequences vulnerability in ash-project usage_rules allows a malicious package publisher to inject terminal control sequences into the output of mix usage_rules.search_docs.

mix usage_rules.search_docs searches Hex documentation through search.hexdocs.pm, which indexes the documentation of every published package, and prints the matching results (title, package, type, doc reference, and highlighted snippets) to the terminal. The formatter in Mix.Tasks.UsageRules.SearchDocs interpolated those publisher-controlled fields verbatim, neutralizing no terminal control characters; the only transform it applied adds escape sequences rather than removing them. A malicious package can embed ANSI terminal escape sequences (cursor movement, line erase, carriage returns, OSC 52 clipboard writes) in its indexed documentation, so when a developer runs a search that surfaces those docs the sequences reach the terminal unchanged — forging the displayed hexdocs URL or a suggested command, hiding text, or writing to the clipboard. No authentication or privileged position is required; only publishing a package.

This issue affects usage_rules: from 0.1.18 before 1.2.8.

Weaknesses & attack patterns

Weakness

CWE-150 · Improper Neutralization of Escape, Meta, or Control Sequences in catalog → MITRE ↗

Attack patterns

CAPEC-93 · Log Injection-Tampering-Forging MITRE ↗

Affected — Hex / usage_rules Hex.pm ↗ Repository ↗

0.1.18 < 1.2.8 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:usage_rules:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Mix.Tasks.UsageRules.SearchDocs'
source files lib/mix/tasks/usage_rules.search_docs.ex
routines 'Elixir.Mix.Tasks.UsageRules.SearchDocs':format_search_result_markdown/4

Affected — GitHub / ash-project/usage_rules Repository ↗

2da7a99 < 3b8ebb4 affected
every other version: unaffected
cpe cpe:2.3:a:ash-project:usage_rules:*:*:*:*:*:*:*:*
modules · source files · routines
modules 'Elixir.Mix.Tasks.UsageRules.SearchDocs'
source files lib/mix/tasks/usage_rules.search_docs.ex
routines 'Elixir.Mix.Tasks.UsageRules.SearchDocs':format_search_result_markdown/4

Configurations

Reachable only when a developer runs mix usage_rules.search_docs in a terminal emulator that interprets ANSI escape sequences and the results include documentation from an attacker-published package (for example a broad --everywhere search).

References

Credits

Peter Ullrich Finder Reporter
Zach Daniel / Ash Project Remediation developer
Jonatan Männchen / EEF Coordinator

CVSS breakdown

CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
« All CVEs