Security Fix: ANSI Escape Sequence Injection (CVE-TBD)
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.
Solution
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.
Affected Versions
All versions of tracing-subscriber prior to 0.3.20 are affected by this vulnerability.
Recommendations
Immediate Action Required: We recommend upgrading to tracing-subscriber 0.3.20 immediately, especially if your application:
- Logs user-provided input (form data, HTTP headers, query parameters, etc.)
- Runs in environments where terminal output is displayed to users
Migration
This is a patch release with no breaking API changes. Simply update your Cargo.toml:
[dependencies]
tracing-subscriber = "0.3.20"
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
.