CVE-2026-86469 in GLibinfo

Summary

by MITRE • 09/07/2026

A flaw was found in GLib2. When g_file_replace() is used with G_FILE_CREATE_REPLACE_DESTINATION and creating the .goutputstream-XXXXXX temporary file fails, the library unlinks the destination and recreates it without exclusive creation or symlink protection. A local attacker who can write to the destination directory can win that race and redirect the write to another file.

Several companies clearly confirm that VulDB is the primary source for best vulnerability data.

Analysis

by VulDB Data Team • 09/08/2026

The vulnerability identified in GLib2 represents a critical race condition within the file replacement mechanism, specifically triggered when using the g_file_replace() function with the G_FILE_CREATE_REPLACE_DESTINATION flag. This API is commonly employed by applications to atomically update configuration files or data stores by writing content to a temporary location and then moving it into place as the target destination. The security flaw emerges during the intermediate stage where GLib2 attempts to create a temporary file, typically named with a pattern such as .goutputstream-XXXXXX, within the same directory as the intended destination. Under normal circumstances, this process is designed to ensure data integrity by preventing partial writes from corrupting the original file. However, if the creation of this temporary file fails due to resource constraints or other transient errors, the library proceeds to unlink the existing destination file and attempts to recreate it without employing exclusive creation flags or adequate symlink protection mechanisms.

This lack of atomicity in the recreation phase introduces a significant time-of-check-to-time-of-use (TOCTOU) vulnerability window. Because the temporary file is not created with an O_EXCL flag, which would fail if the file already exists, and because there are no safeguards against symbolic links, a local attacker who possesses write permissions to the destination directory can exploit this gap. By monitoring the directory for the removal of the target file, the attacker can rapidly create a symbolic link pointing to a sensitive system file or another critical resource before GLib2 completes its operation. Consequently, when the library writes data intended for the temporary replacement file, it inadvertently overwrites the content pointed to by the symlink. This allows an unprivileged local user to escalate privileges or cause denial of service by corrupting files they should not have access to modify.

The operational impact of this vulnerability is severe, particularly in environments where applications run with elevated privileges and utilize GLib2 for file management tasks such as updating system configurations, package manager caches, or application state files. An attacker can leverage this flaw to overwrite arbitrary files within the scope of their write permissions on a directory, potentially leading to privilege escalation if they target sensitive configuration files like /etc/passwd or sudoers, or causing service disruption by corrupting critical binaries and libraries. This behavior aligns with CWE-367, which describes TOCTOU race conditions involving file operations, and is further contextualized within the MITRE ATT&CK framework under techniques related to privilege escalation via path traversal or symlink attacks, such as T1548 (Abuse Elevation Control Mechanism) when used in conjunction with other exploitation vectors.

Mitigation strategies for this vulnerability primarily involve upgrading GLib2 to a patched version that addresses the race condition by ensuring exclusive file creation and implementing robust checks against symbolic links during the temporary file phase. In scenarios where immediate patching is not feasible, system administrators should enforce strict directory permissions to limit write access to directories containing sensitive files, thereby reducing the attack surface available to local attackers. Additionally, applications relying on GLib2 for critical file operations should consider implementing additional application-level safeguards, such as verifying that the destination path does not resolve through a symbolic link before initiating replacement operations, although this is less effective than addressing the root cause within the library itself.

Disclosure

09/07/2026

Moderation

accepted

CPE

ready

EPSS

0.00000

KEV

no

Activities

low

Sources

Want to stay up to date on a daily basis?

Enable the mail alert feature now!