{"id":"CVE-2025-58160","aliases":["CVE-2025-58160","GHSA-xwfj-jgwm-7wp5","RUSTSEC-2025-0055"],"related":[],"kind":"vulnerability","state":"published","title":"Tracing logging user input may result in poisoning logs with ANSI escape sequences","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Impact\n\nPrevious 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:\n\n- Manipulate terminal title bars\n- Clear screens or modify terminal display\n- Potentially mislead users through terminal manipulation\n\nIn 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.\n\n### Patches\n\n`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.\n\n### Workarounds\n\nAvoid printing logs to terminal emulators without escaping ANSI control sequences.\n\n### References\n\nhttps://www.packetlabs.net/posts/weaponizing-ansi-escape-sequences/\n\n\n### Acknowledgments\n\nWe would like to thank [zefr0x](http://github.com/zefr0x) who responsibly reported the issue at `security@tokio.rs`.\n\nIf you believe you have found a security vulnerability in any tokio-rs project, please email us at `security@tokio.rs`.","format":"markdown","source":"ghsa"},{"lang":"en","text":"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:\n\n- Manipulate terminal title bars\n- Clear screens or modify terminal display\n- Potentially mislead users through terminal manipulation\n\nIn 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.\n\nThis was patched in [PR #3368](https://github.com/tokio-rs/tracing/pull/3368) to escape ANSI control characters from user input.","format":"markdown","source":"rustsec"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2025-08-29T12:00:00.000Z","modified":"2026-10-18T21:10:00.120Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":2.3,"rating":"LOW"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:4.0","vector":"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","score":2.3,"rating":"LOW"},{"scorer":"GitHub","scheme":"CVSS:4.0","vector":"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","rating":"LOW"}],"cwes":["CWE-150"],"affected":[{"ranges":[{"version":"< 0.3.20","status":"affected"}],"vendor":"tokio-rs","product":"tracing","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"0.3.20"}],"ecosystem":"crates.io","package":"tracing-subscriber","purl":"pkg:cargo/tracing-subscriber","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0.0.0-0","status":"affected","fixed":"0.3.20"}],"ecosystem":"crates.io","package":"tracing-subscriber","purl":"pkg:cargo/tracing-subscriber","source":"rustsec"}],"references":[{"url":"https://github.com/tokio-rs/tracing/security/advisories/GHSA-xwfj-jgwm-7wp5","tags":["web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-58160","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/tokio-rs/tracing","tags":["package"],"sources":["ghsa"]},{"url":"https://rustsec.org/advisories/RUSTSEC-2025-0055.html","tags":["advisory","web"],"sources":["ghsa","rustsec"]},{"url":"https://crates.io/crates/tracing-subscriber","tags":["package"],"sources":["rustsec"]},{"url":"https://github.com/tokio-rs/tracing/pull/3368","tags":["web"],"sources":["rustsec"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"yes","technicalImpact":"partial","date":"2025-09-02T14:08:23.820Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-58160","url":"https://www.cve.org/CVERecord?id=CVE-2025-58160","licence":"CVE Terms of Use","modified":"2025-09-02T14:08:42.323Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-xwfj-jgwm-7wp5","url":"https://github.com/advisories/GHSA-xwfj-jgwm-7wp5","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:27.766Z"},{"source":"rustsec","name":"RustSec Advisory Database","id":"RUSTSEC-2025-0055","url":"https://rustsec.org/advisories/RUSTSEC-2025-0055.html","licence":"CC0-1.0","modified":"2026-10-12T18:00:11.495Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-58160","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-58160","licence":"Public domain","modified":"2026-10-18T21:10:00.120Z"}],"updatedAt":"2026-11-25T22:59:03.911Z","epss":{"score":0.004,"percentile":0.36368,"date":"2026-12-01T12:00:22.000Z"}}