The vulnerability CVE-2023-31437 allows an attacker to modify a sealed log file such that some log messages are not displayed. The provided patch file CVE-2023-31437.patch modifies src/libsystemd/sd-journal/journal-verify.c.
-
The function verify_data was patched to add specific checks ensuring that data objects correctly link back to their entry objects. The absence of this check in the original version of verify_data made it vulnerable, as manipulated linkages could lead to hidden entries.
-
The main verification function journal_file_verify was patched to include a call to a new function verify_field_hash_table. This new function performs extensive checks on the field hash table, which is crucial for log filtering. The original journal_file_verify lacked these comprehensive checks, making the overall verification process susceptible to manipulations that could hide log entries when filters are applied.
The functions verify_data and journal_file_verify are identified as vulnerable because they processed the potentially malicious log file structure without these crucial integrity checks, which the patch introduces. The newly added function verify_field_hash_table is part of the mitigation, not a vulnerable function itself.