CVE-2023-32712 Overview
CVE-2023-32712 is a Log Injection vulnerability affecting Splunk Enterprise and Universal Forwarder that allows attackers to inject American National Standards Institute (ANSI) escape codes into Splunk log files. When these malicious log files are read by a vulnerable terminal application, the injected escape codes can potentially lead to code execution within the terminal application itself.
Critical Impact
Attackers can inject ANSI escape codes into Splunk log files that may result in code execution when viewed in vulnerable terminal applications, though exploitation requires significant user interaction.
Affected Products
- Splunk Enterprise versions below 9.1.0.2
- Splunk Enterprise versions below 9.0.5.1
- Splunk Enterprise versions below 8.2.11.2
- Universal Forwarder versions 9.1.0.1, 9.0.5, 8.2.11, and lower (when management services are active and network-accessible)
Discovery Timeline
- June 1, 2023 - CVE-2023-32712 published to NVD
- November 21, 2024 - Last updated in NVD database
Technical Details for CVE-2023-32712
Vulnerability Analysis
This vulnerability belongs to the Log Injection (CWE-117) and Improper Encoding or Escaping of Output (CWE-116) categories. The attack chain is indirect—Splunk Enterprise and Universal Forwarder are not directly compromised. Instead, the vulnerability exploits the trust relationship between log files and terminal emulators that interpret ANSI escape sequences.
ANSI escape codes are special character sequences used by terminal applications to control cursor positioning, text formatting, and other display features. However, some terminal emulators support dangerous escape sequences that can execute arbitrary commands or modify system state. When an attacker injects these sequences into Splunk log files and a user subsequently views those logs in a vulnerable terminal, the terminal interprets and executes the malicious escape codes.
The attack surface varies depending on the deployment configuration. Universal Forwarder versions 9.0.x and 9.1.x bind management services to localhost, reducing network exposure. Version 9.1 further mitigates risk by using Unix Domain Sockets (UDS) for inter-process communication.
Root Cause
The root cause is improper output encoding (CWE-116) combined with log injection (CWE-117). Splunk does not sanitize or escape ANSI control characters when writing to log files. This allows attackers who can influence logged data to embed malicious escape sequences that persist in the log files and are later interpreted by terminal applications.
Attack Vector
The attack requires network access to inject malicious data that gets logged by Splunk, but the actual exploitation depends on user interaction. The attacker must:
- Inject ANSI escape codes into data that Splunk will log (e.g., through crafted HTTP requests, log messages, or other input sources)
- Wait for an administrator or user to view the poisoned log file in a terminal emulator that supports dangerous escape sequences
- Rely on the user's terminal application to interpret and execute the malicious escape codes
For Universal Forwarder instances with management services exposed over the network (versions 9.1.0.1, 9.0.5, 8.2.11, and below), the attack surface is larger. The impact varies significantly based on the terminal application's permissions and whether the user copies the log file to another machine for viewing.
The malicious escape codes are embedded within log entries and may appear innocuous in text editors but execute when rendered by a vulnerable terminal. Common attack payloads include terminal title manipulation, clipboard injection, and in severe cases, command execution through terminal-specific escape sequences.
Detection Methods for CVE-2023-32712
Indicators of Compromise
- Presence of ANSI escape sequences (starting with \\x1b[ or \033[) in Splunk log files
- Unusual control characters in log entries that don't correspond to legitimate application output
- Log entries containing suspicious sequences like \\x1b] (Operating System Command sequences) or \\x1bP (Device Control String)
Detection Strategies
- Monitor Splunk log files for non-printable control characters and escape sequences using pattern matching
- Implement log analysis rules to alert on potential ANSI injection attempts in indexed data
- Review Universal Forwarder configurations to identify instances with management services exposed to the network
- Utilize the Splunk Research detection for identifying potential exploitation attempts
Monitoring Recommendations
- Configure terminal applications to disable interpretation of dangerous escape sequences when viewing untrusted log files
- Implement centralized log review processes that use sanitizing viewers rather than raw terminal output
- Monitor network access to Universal Forwarder management ports for unauthorized connection attempts
How to Mitigate CVE-2023-32712
Immediate Actions Required
- Upgrade Splunk Enterprise to version 9.1.0.2, 9.0.5.1, or 8.2.11.2 or later
- Upgrade Universal Forwarder to versions that bind management services to localhost or use UDS
- Restrict network access to Universal Forwarder management services using firewall rules
- Use log viewers that sanitize or disable ANSI escape sequence interpretation when reviewing Splunk logs
Patch Information
Splunk has released patches addressing this vulnerability. Refer to the Splunk Security Advisory SVD-2023-0606 for detailed upgrade instructions and version-specific guidance. The fixed versions are:
- Splunk Enterprise 9.1.0.2 and later
- Splunk Enterprise 9.0.5.1 and later
- Splunk Enterprise 8.2.11.2 and later
Workarounds
- Configure terminal emulators to disable dangerous escape sequences (e.g., use less -R with caution or pipe output through cat -v to visualize control characters)
- View Splunk log files only through the Splunk web interface or sanitizing text editors rather than terminal applications
- Restrict network access to Universal Forwarder management services to trusted hosts only
- Review SVD-2022-0605 for additional guidance on securing Universal Forwarder management services
# Example: View log files safely by converting escape sequences to visible characters
cat -v /opt/splunk/var/log/splunk/splunkd.log | less
# Alternatively, use sed to strip ANSI escape codes before viewing
sed 's/\\x1b\[[0-9;]*[a-zA-Z]//g' /opt/splunk/var/log/splunk/splunkd.log | less
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

