CVE-2025-58160
JSON

2.3low

Tracing logging user input may result in poisoning logs with ANSI escape sequences

Severity
2.3low CVSS:4.0 by GitHub_M
Exploit likelihood
0.40% (higher than 36% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-xwfj-jgwm-7wp5RUSTSEC-2025-0055

Description

tracing is a framework for instrumenting Rust programs to collect structured, event-based diagnostic information. Prior to version 0.3.20, tracing-subscriber was vulnerable to ANSI escape sequence injection attacks. Untrusted user input containing ANSI escape sequences could be injected into terminal output when logged, potentially allowing attackers to manipulate terminal title bars, clear screens or modify terminal display, and potentially mislead users through terminal manipulation. tracing-subscriber version 0.3.20 fixes this vulnerability by escaping ANSI control characters when writing events to destinations that may be printed to the terminal. A workaround involves avoiding printing logs to terminal emulators without escaping ANSI control sequences.

Affected

Product or packageVersionsReported by
tokio-rs tracing< 0.3.20CVE List
tracing-subscriber (crates.io)before 0.3.20, from 0.0.0-0 before 0.3.20GitHub Advisory Database, RustSec Advisory Database

All scores

GitHub_M2.3low CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N
GitHublow CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:P/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N

Classification

CWE-150

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

tracing is a framework for instrumenting Rust programs to collect structured, event-based diagnostic information. Prior to version 0.3.20, tracing-subscriber was vulnerable to ANSI escape sequence injection attacks. Untrusted user input containing ANSI escape sequences could be injected into terminal output when logged, potentially allowing attackers to manipulate terminal title bars, clear screens or modify terminal display, and potentially mislead users through terminal manipulation. tracing-subscriber version 0.3.20 fixes this vulnerability by escaping ANSI control characters when writing events to destinations that may be printed to the terminal. A workaround involves avoiding printing logs to terminal emulators without escaping ANSI control sequences.

GitHub Advisory Database
Impact

Previous versions of tracing-subscriber were vulnerable to ANSI escape sequence injection attacks. Untrusted user input containing ANSI escape sequences could be injected into terminal output when logged, potentially allowing attackers to:

  • Manipulate terminal title bars
  • Clear screens or modify terminal display
  • Potentially mislead users through terminal manipulation

In isolation, impact is minimal, however security issues have been found in terminal emulators that enabled an attacker to use ANSI escape sequences via logs to exploit vulnerabilities in the terminal emulator.

Patches

tracing-subscriber version 0.3.20 fixes this vulnerability by escaping ANSI control characters in when writing events to destinations that may be printed to the terminal.

Workarounds

Avoid printing logs to terminal emulators without escaping ANSI control sequences.

References

https://www.packetlabs.net/posts/weaponizing-ansi-escape-sequences/

Acknowledgments

We would like to thank zefr0x who responsibly reported the issue at security@tokio.rs.

If you believe you have found a security vulnerability in any tokio-rs project, please email us at security@tokio.rs.

RustSec Advisory Database

Previous versions of tracing-subscriber were vulnerable to ANSI escape sequence injection attacks. Untrusted user input containing ANSI escape sequences could be injected into terminal output when logged, potentially allowing attackers to:

  • Manipulate terminal title bars
  • Clear screens or modify terminal display
  • Potentially mislead users through terminal manipulation

In isolation, impact is minimal, however security issues have been found in terminal emulators that enabled an attacker to use ANSI escape sequences via logs to exploit vulnerabilities in the terminal emulator.

This was patched in PR #3368 to escape ANSI control characters from user input.

NVD (es)

tracing es un framework para instrumentar programas Rust para recopilar información de diagnóstico estructurada y basada en eventos. Antes de la versión 0.3.20, tracing-subscriber era vulnerable a ataques de inyección de secuencias de escape ANSI. La entrada de usuario no confiable que contenía secuencias de escape ANSI podría inyectarse en la salida de la terminal al registrarse, lo que podría permitir a los atacantes manipular las barras de título de la terminal, borrar pantallas o modificar la visualización de la terminal, y potencialmente engañar a los usuarios mediante la manipulación de la terminal. tracing-subscriber versión 0.3.20 corrige esta vulnerabilidad escapando los caracteres de control ANSI al escribir eventos a destinos que pueden imprimirse en la terminal. Una solución alternativa implica evitar imprimir registros en emuladores de terminal sin escapar las secuencias de control ANSI.

References

Sources

SourceRecordLicence
CVE ListCVE-2025-58160 changed 2025-09-02CVE Terms of Use
GitHub Advisory DatabaseGHSA-xwfj-jgwm-7wp5 changed 2026-09-10CC-BY-4.0
RustSec Advisory DatabaseRUSTSEC-2025-0055 changed 2026-10-12CC0-1.0
NVDCVE-2025-58160 changed 2026-10-18Public domain