CVE-2024-45339 Vulnerability when creating log files in github.com/golang/glog

High 7.1 Published Updated

An attacker can overwrite sensitive files by planting symbolic links in the default log directory, affecting applications using the glog library.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Local or same network only
Victim action needed
Not needed
Fix
Available

What is CVE-2024-45339?

CVE-2024-45339 is a high-severity path traversal vulnerability in github.com/golang/glog, published on 28 Jan 2025. It can only be exploited from the same machine or local network, with no action from the victim.

Official description

When logs are written to a widely-writable directory (the default), an unprivileged attacker may predict a privileged process's log file path and pre-create a symbolic link to a sensitive file in its place. When that privileged process runs, it will follow the planted symlink and overwrite that sensitive file. To fix that, glog now causes the program to exit (with status code 2) when it finds that the configured log file already exists.

Which versions are affected by CVE-2024-45339?

3 open source packages ship an affected version, including github.com/golang/glog.

PackageAffectedFixed in
github.com/golang/glog GoAll versions1.2.4
github.com/golang/glog GoAll versions1.2.4
github.com/golang/glog GoAll versions1.2.4
Linux distribution packages (17)
google-osconfig-agent SUSE:Linux Enterprise Micro 5.5All versions20250115.01-150000.1.44.1
google-osconfig-agent SUSE:Linux Enterprise Micro 5.5All versions20250416.02-150000.1.50.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 12All versions20250115.01-1.35.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 12All versions20250416.02-1.41.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 15 SP3All versions20250115.01-150000.1.44.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 15 SP3All versions20250416.02-150000.1.50.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 15 SP4All versions20250115.01-150000.1.44.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 15 SP4All versions20250416.02-150000.1.50.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 15 SP5All versions20250115.01-150000.1.44.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 15 SP5All versions20250416.02-150000.1.50.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 15 SP6All versions20250115.01-150000.1.44.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 15 SP6All versions20250416.02-150000.1.50.1
google-osconfig-agent SUSE:Linux Enterprise Module for Public Cloud 15 SP7All versions20250416.02-150000.1.50.1
google-osconfig-agent SUSE:Linux Micro 6.1All versions20250416.02-slfo.1.1_1.1
google-osconfig-agent openSUSE:Leap 15.6All versions20250115.01-150000.1.44.1
google-osconfig-agent openSUSE:Leap 15.6All versions20250416.02-150000.1.50.1
google-osconfig-agent openSUSE:TumbleweedAll versions20250115.01-2.1

How do I fix CVE-2024-45339?

Upgrade github.com/golang/glog to 1.2.4 or later.

Upgrade, and resolve every user-supplied path against an allowed base folder before opening it. More about Path traversal.

Is CVE-2024-45339 being exploited?

There is no known exploitation of CVE-2024-45339 in the wild and no public exploit code.

Sources

Also known as AZL-56066, AZL-56069, AZL-56075, AZL-56078, AZL-56379, AZL-56402 and 20 more.

Is CVE-2024-45339 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free