CVE Vulnerabilities

CVE-2025-0913

Improper Link Resolution Before File Access ('Link Following')

Published: Jun 11, 2025 | Modified: Aug 08, 2025
CVSS 3.x
N/A
Source:
NVD
CVSS 2.x
RedHat/V2
RedHat/V3
Ubuntu
MEDIUM
root.io logo minimus.io logo echo.ai logo

os.OpenFile(path, os.O_CREATE|O_EXCL) behaved differently on Unix and Windows systems when the target path was a dangling symlink. On Unix systems, OpenFile with O_CREATE and O_EXCL flags never follows symlinks. On Windows, when the target path was a symlink to a nonexistent location, OpenFile would create a file in that location. OpenFile now always returns an error when the O_CREATE and O_EXCL flags are both set and the target path is a symlink.

Weakness

The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.

Affected Software

NameVendorStart VersionEnd Version
GoGolang*1.23.10 (excluding)
GoGolang1.24.0 (including)1.24.4 (excluding)
Golang-1.10Ubuntuesm-infra-legacy/trusty*
Golang-1.10Ubuntuesm-infra/bionic*
Golang-1.10Ubuntuesm-infra/xenial*
Golang-1.13Ubuntuesm-apps/bionic*
Golang-1.13Ubuntuesm-apps/jammy*
Golang-1.13Ubuntuesm-apps/xenial*
Golang-1.13Ubuntuesm-infra/focal*
Golang-1.13Ubuntujammy*
Golang-1.14Ubuntuesm-infra/focal*
Golang-1.16Ubuntuesm-apps/bionic*
Golang-1.16Ubuntuesm-apps/focal*
Golang-1.17Ubuntujammy*
Golang-1.18Ubuntuesm-apps/bionic*
Golang-1.18Ubuntuesm-apps/xenial*
Golang-1.18Ubuntujammy*
Golang-1.20Ubuntuesm-apps/jammy*
Golang-1.20Ubuntujammy*
Golang-1.21Ubuntuesm-apps/jammy*
Golang-1.21Ubuntuesm-apps/noble*
Golang-1.21Ubuntujammy*
Golang-1.21Ubuntunoble*
Golang-1.22Ubuntuesm-apps/jammy*
Golang-1.22Ubuntujammy*
Golang-1.22Ubuntunoble*
Golang-1.22Ubuntuoracular*
Golang-1.23Ubuntudevel*
Golang-1.23Ubuntuesm-apps/jammy*
Golang-1.23Ubuntuesm-apps/noble*
Golang-1.23Ubuntujammy*
Golang-1.23Ubuntunoble*
Golang-1.23Ubuntuoracular*
Golang-1.23Ubuntuplucky*
Golang-1.23Ubuntuquesting*
Golang-1.24Ubuntudevel*
Golang-1.24Ubuntuplucky*
Golang-1.24Ubuntuquesting*
Golang-1.6Ubuntuesm-infra/xenial*
Golang-1.8Ubuntuesm-apps/bionic*
Golang-1.9Ubuntuesm-apps/bionic*

Potential Mitigations

  • Follow the principle of least privilege when assigning access rights to entities in a software system.
  • Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

References