The vulnerability lies in the improper handling of []byte data types within the audit logging subsystem of OpenBao. When a response from a subsystem like sys/raw contained sensitive data in a []byte field, the audit logging mechanism failed to redact or HMAC this data before writing it to the audit log.
The root cause was in the audit.HashResponse and audit.HashStructure functions. The process involved creating a JSON-marshalled copy of the response data. This conversion turned []byte slices into base64-encoded strings. However, the core hashing logic, implemented in audit.HashStructure and its internal hashWalker, was designed to walk the original data structure and only acted upon fields that were of type string. It did not have a mechanism to handle []byte fields, so they were never passed to the hashing callback. Consequently, the base64-encoded (and thus easily decodable) sensitive data was persisted in the audit logs.
The patch addresses this by refactoring the entire data walking and hashing mechanism. It now operates on a single data structure that has been processed by json.Marshal and json.Unmarshal, ensuring type consistency. The new logic correctly identifies and hashes all string values that are not explicitly ignored, which now includes the base64-encoded representations of the original []byte fields, effectively redacting the sensitive information.