cve.bz

CVE-2026-140038 Binutils: gprofng uses predictable /tmp directory with unchecked mkdir() enabling symlink-based file clobber

5.1 medium

Medium (5.1) in red hat.

On this page
A flaw was found in the gprofng component of binutils. The utility creates temporary directories in shared locations using predictable names based on user and process identifiers without verifying whether the directory already exists. A local attacker can exploit this flaw by pre-creating the expected directory and placing symbolic links inside it, causing a victim's process to overwrite or truncate arbitrary files writable by that victim.

Severity

CVSS 3.1

5.1 medium
CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:L
CWE
CWE-377 Insecure Temporary File deprecated by MITRE
OWASP Top 10
A01:2025 Broken Access Control
Published
Modified
Assigned by
redhat (CNA)
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Ask an AI about this CVE

Show the promptExplain CVE-2026-140038 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-140038?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-140038?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-140038 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This vulnerability is evaluated as Moderate severity because exploitation is restricted to local multi-user environments, requiring precise process ID prediction and victim execution, which confines the impact to files writable by the invoking user without elevating system privileges. While the binutils package is installed by default across Red Hat Enterprise Linux systems, the gprofng profiler is typically executed interactively for developer performance analysis rather than as an automated or privileged system service. Consequently, the flaw presents no risk of remote compromise or direct administrative privilege escalation.

Red Hat's mitigation

Isolate execution environments to prevent shared temporary file access, or restrict profiling activities on shared hosts:

1. Execute gprofng workflows within an isolated container (such as via Podman) or a dedicated mount namespace with a private /tmp filesystem, preventing other local users from pre-creating predictable temporary paths.

2. Avoid running gprofng analysis sessions on multi-user systems where untrusted local accounts have access to the shared /tmp directory.

Caveats: Running profiling tools inside an isolated container or private namespace may restrict visibility into processes or hardware performance counters on the host system without granting additional container capabilities.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10binutilsFix deferred
Red Hat Enterprise Linux 10gcc-toolset-15-binutilsFix deferred
Red Hat Enterprise Linux 10gcc-toolset-16-binutilsFix deferred
Red Hat Enterprise Linux 10gdbFix deferred
Red Hat Enterprise Linux 10mingw-binutilsFix deferred
Red Hat Enterprise Linux 6binutilsFix deferred
Red Hat Enterprise Linux 7binutilsFix deferred
Red Hat Enterprise Linux 7gdbFix deferred
Red Hat Enterprise Linux 8binutilsFix deferred
Red Hat Enterprise Linux 8gcc-toolset-15-binutilsFix deferred
Red Hat Enterprise Linux 8gcc-toolset-15-gdbFix deferred
Red Hat Enterprise Linux 8gcc-toolset-16-binutilsFix deferred
Red Hat Enterprise Linux 8gcc-toolset-16-gdbFix deferred
Red Hat Enterprise Linux 8gdbFix deferred
Red Hat Enterprise Linux 8mingw-binutilsFix deferred
Red Hat Enterprise Linux 9binutilsFix deferred
Red Hat Enterprise Linux 9gcc-toolset-15-binutilsFix deferred
Red Hat Enterprise Linux 9gcc-toolset-16-binutilsFix deferred
Red Hat Enterprise Linux 9gdbFix deferred
Red Hat Enterprise Linux 9mingw-binutilsFix deferred
5 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-140038.

Attack patterns (CAPEC)

  • CAPEC-149 Explore for Predictable Temporary File Names Severity: Medium
  • CAPEC-155 Screen Temporary Files for Sensitive Information Likelihood: Medium · Severity: Medium

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON