The vulnerability lies in the application's startup logging. When SpiceDB starts with the default log level of info, it logs its entire configuration for debugging and auditing purposes. The function responsible for generating this configuration output is pkg/cmd/server.Config.DebugMap. Before the patch, this function would serialize the entire DatastoreConfig object, including the URI field which contains the full database connection string with credentials, without any redaction. This resulted in sensitive credentials being written to the startup logs.
The patch addresses this by modifying the DebugMap functions. Specifically, pkg/cmd/server.Config.DebugMap was updated to recursively call the DebugMap method of the nested DatastoreConfig object, instead of including the raw object. The pkg/cmd/datastore.Config.DebugMap function, in turn, ensures that the URI field is replaced with the string "(sensitive)".
An attacker with access to the logs (e.g., a local user, or access to a log aggregation system) could retrieve the database credentials, leading to a full compromise of the database. The vulnerable functions are the DebugMap methods that were modified to implement this redaction.