CVE-2026-4878
published 2026-04-09CVE-2026-4878: A flaw was found in libcap. A local unprivileged user can exploit a Time-of-check-to-time-of-use (TOCTOU) race condition in the `cap_set_file()` function. This…
PriorityP338high7CVSS 3.1
AVLACHPRLUINSUCHIHAH
EPSS
0.19%
8.6th percentile
A flaw was found in libcap. A local unprivileged user can exploit a Time-of-check-to-time-of-use (TOCTOU) race condition in the `cap_set_file()` function. This allows an attacker with write access to a parent directory to redirect file capability updates to an attacker-controlled file. By doing so, capabilities can be injected into or stripped from unintended executables, leading to privilege escalation.
Affected
6 ranges
| Vendor | Product | Version range | Fixed in |
|---|---|---|---|
| debian | libcap2 | < libcap2 1:2.78-1 (forky) | libcap2 1:2.78-1 (forky) |
| redhat | enterprise_linux | — | — |
| redhat | enterprise_linux | — | — |
| redhat | enterprise_linux | — | — |
| redhat | openshift_container_platform | — | — |
| ubuntu | libcap2 | — | — |
CVSS provenance
nvdv3.17.0HIGHCVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
osv6.7MEDIUM
vendor_debian6.7MEDIUM
vendor_redhat6.7MEDIUM
Stop checking back — get the weekly exploitation signal.
Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.
Ubuntu
libcap vulnerability
vendor_ubuntu·2026-06-23
CVE-2026-4878 libcap vulnerability
Title: libcap vulnerability
Summary: libcap could be made to modify capabilities on arbitrary files.
USN-8193-1 fixed a vulnerability in libcap. This update provides the
corresponding update for Ubuntu 14.04 LTS, Ubuntu 16.04 LTS,
Ubuntu 18.04 LTS, and Ubuntu 20.04 LTS.
Original advisory details:
Ali Raza discovered that libcap incorrectly handled file capability
updates. A local attacker could possibly use this issue to inject or strip
capabilities into arbitrary executables and escalate privileges.
Instructions: In general, a standard system update will make all the necessary changes.
Red Hat
libcap: libcap: Privilege escalation via TOCTOU race condition in cap_set_file()
vendor_redhat·2026-04-06·CVSS 6.7
CVE-2026-4878 [MEDIUM] CWE-367 libcap: libcap: Privilege escalation via TOCTOU race condition in cap_set_file()
libcap: libcap: Privilege escalation via TOCTOU race condition in cap_set_file()
A flaw was found in libcap. A local unprivileged user can exploit a Time-of-check-to-time-of-use (TOCTOU) race condition in the `cap_set_file()` function. This allows an attacker with write access to a parent directory to redirect file capability updates to an attacker-controlled file. By doing so, capabilities can be injected into or stripped from unintended executables, leading to privilege escalation.
Statement: This is an Important flaw. A Time-of-Check-to-Time-of-Use (TOCTOU) race condition in libcap's cap_set_file() allows a local unprivileged user to escalate privileges. An attacker with write access to a parent directory can exploit a narrow window during file capability updates to redirect capabilit
Debian
CVE-2026-4878: libcap2
vendor_debian·2026·CVSS 6.7
CVE-2026-4878 [MEDIUM] CVE-2026-4878: libcap2
bookworm: open
bullseye: open
forky: resolved (fixed in 1:2.78-1)
sid: resolved (fixed in 1:2.78-1)
trixie: open
VulDB
libcap up to 2.77 cap_set_file allocation of resources (EUVD-2026-20910 / Nessus ID 305106)
vuldb·2026-05-20·CVSS 7.0
CVE-2026-4878 [HIGH] libcap up to 2.77 cap_set_file allocation of resources (EUVD-2026-20910 / Nessus ID 305106)
A vulnerability identified as critical has been detected in libcap up to 2.77. Affected by this vulnerability is the function cap_set_file. The manipulation leads to allocation of resources.
This vulnerability is referenced as CVE-2026-4878. The attack can only be performed from a local environment. No exploit is available.
It is recommended to apply a patch to fix this issue.
OSV
CVE-2026-4878: [Address a potential TOCTOU race condition in cap_set_file()]
osv·2026-04-07·CVSS 6.7
CVE-2026-4878 [MEDIUM] CVE-2026-4878: [Address a potential TOCTOU race condition in cap_set_file()]
[Address a potential TOCTOU race condition in cap_set_file()]
No detection rules found.
No public exploits indexed.
Bugzilla
CVE-2026-4878 libcap: libcap: Privilege escalation via TOCTOU race condition in cap_set_file() [fedora-all]
bugzilla·2026-05-25·CVSS 7.0
CVE-2026-4878 [HIGH] CVE-2026-4878 libcap: libcap: Privilege escalation via TOCTOU race condition in cap_set_file() [fedora-all]
CVE-2026-4878 libcap: libcap: Privilege escalation via TOCTOU race condition in cap_set_file() [fedora-all]
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.
Discussion:
This was already addressed in https://bugzilla.redhat.com/show_bug.cgi?id=2447554
---
*** This bug has been marked as a duplicate of bug 2447554 ***
Bugzilla
CVE-2026-4878 libcap: libcap: Privilege escalation via TOCTOU race condition in cap_set_file()
bugzilla·2026-03-26·CVSS 6.7
CVE-2026-4878 [MEDIUM] CVE-2026-4878 libcap: libcap: Privilege escalation via TOCTOU race condition in cap_set_file()
CVE-2026-4878 libcap: libcap: Privilege escalation via TOCTOU race condition in cap_set_file()
A time-of-check-to-time-of-use (TOCTOU) race condition in libcap’s cap_set_file() allows a local unprivileged user to redirect file capability updates to an attacker‑controlled file and gain elevated privileges. The function first validates the target path with lstat() (which does not follow symlinks) and enforces that it is a regular, non‑symlink file, but then applies or removes security.capability using setxattr() / removexattr(), which re-resolve the path and do follow symlinks. An attacker with write access to the parent directory can exploit the window between these calls by atomically swapping the validated regular file with a symlink or alternate file using renameat2(RENAME_EXCHANGE). As
Bugzilla
CVE-2025-4878 mingw-libssh2: Use of uninitialized variable in privatekey_from_file() [fedora-42]
bugzilla·2025-07-22·CVSS 3.6
CVE-2025-4878 [LOW] CVE-2025-4878 mingw-libssh2: Use of uninitialized variable in privatekey_from_file() [fedora-42]
CVE-2025-4878 mingw-libssh2: Use of uninitialized variable in privatekey_from_file() [fedora-42]
Disclaimer: Community trackers are created by Red Hat Product Security team on a best effort basis. Package maintainers are required to ascertain if the flaw indeed affects their package, before starting the update process.
The following link provides references to all essential vulnerability management information. If something is wrong or missing, please contact a member of PSIRT.
https://spaces.redhat.com/display/PRODSEC/Vulnerability+Management+-+Essential+Documents+for+Engineering+Teams
Discussion:
This message is a reminder that Fedora Linux 42 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 42 on 2026-05-13.
It is Fedora's policy to close
Bugzilla
CVE-2025-4878 libssh: Use of uninitialized variable in privatekey_from_file()
bugzilla·2025-07-03·CVSS 3.6
CVE-2025-4878 [LOW] CVE-2025-4878 libssh: Use of uninitialized variable in privatekey_from_file()
CVE-2025-4878 libssh: Use of uninitialized variable in privatekey_from_file()
The privatekey_from_file() uses an uninitialized variable under certain conditions, such as if the file specified by the filename argument doesn't exist. This causes the code to return an invalid private key. This defect, in turn, might cause signing failure. The bug might also cause a Use-After-Free or corrupt the heap. Note that privatekey_from_file() is a deprecated function and shouldn't be used anymore!
Discussion:
This issue has been addressed in the following products:
Red Hat Enterprise Linux 9
Via RHSA-2026:18683 https://access.redhat.com/errata/RHSA-2026:18683
Wiz
CVE-2026-4878 Impact, Exploitability, and Mitigation Steps | Wiz
blogs_wiz·CVSS 9.0
CVE-2026-4878 [CRITICAL] CVE-2026-4878 Impact, Exploitability, and Mitigation Steps | Wiz
## CVE-2026-4878 :
Linux Debian vulnerability analysis and mitigation
cap_set_file()
Source : NVD
## 6.7
Score
Published April 9, 2026
Severity MEDIUM
CNA Score 6.7
Affected Technologies
Linux Debian
Linux Red Hat
Has Public Exploit No
Has CISA KEV Exploit No
CISA KEV Release Date N/A
CISA KEV Due Date N/A
Exploitation Probability Percentile (EPSS) N/A
Exploitation Probability (EPSS) N/A
Affected packages and libraries
libcap2
libcap
Sources
NVD
Alpine edge Severity MEDIUM Has Fix Added at: Apr 09, 2026
Debian 11, 12, 13 Severity MEDIUM No Fix Added at: Apr 06, 2026
Debian 14 Severity MEDIUM Has Fix Added at: Apr 06, 2026
Echo Severity MEDIUM Has Fix Added at: Apr 06, 2026
Red Hat 6, 7, 8, 9, 10 Severity HIGH No Fix Added at: Apr 09, 2026
## Get a CVE risk as
https://access.redhat.com/errata/RHSA-2026:12423https://access.redhat.com/errata/RHSA-2026:12441https://access.redhat.com/errata/RHSA-2026:13285https://access.redhat.com/errata/RHSA-2026:14162https://access.redhat.com/errata/RHSA-2026:14937https://access.redhat.com/errata/RHSA-2026:19130https://access.redhat.com/errata/RHSA-2026:19346https://access.redhat.com/errata/RHSA-2026:19456https://access.redhat.com/errata/RHSA-2026:19458https://access.redhat.com/errata/RHSA-2026:20595https://access.redhat.com/errata/RHSA-2026:21254https://access.redhat.com/errata/RHSA-2026:21275https://access.redhat.com/errata/RHSA-2026:22634https://access.redhat.com/errata/RHSA-2026:22957https://access.redhat.com/errata/RHSA-2026:23233https://access.redhat.com/errata/RHSA-2026:23245https://access.redhat.com/errata/RHSA-2026:24346https://access.redhat.com/errata/RHSA-2026:25044https://access.redhat.com/errata/RHSA-2026:25096https://access.redhat.com/errata/RHSA-2026:25181https://access.redhat.com/errata/RHSA-2026:26542https://access.redhat.com/errata/RHSA-2026:27998https://access.redhat.com/errata/RHSA-2026:28887https://access.redhat.com/errata/RHSA-2026:29197https://access.redhat.com/errata/RHSA-2026:30078https://access.redhat.com/errata/RHSA-2026:30087https://access.redhat.com/errata/RHSA-2026:30088https://access.redhat.com/errata/RHSA-2026:30089https://access.redhat.com/errata/RHSA-2026:34098https://access.redhat.com/errata/RHSA-2026:39981https://access.redhat.com/errata/RHSA-2026:7473https://access.redhat.com/security/cve/CVE-2026-4878https://bugzilla.redhat.com/show_bug.cgi?id=2447554https://bugzilla.redhat.com/show_bug.cgi?id=2451615http://www.openwall.com/lists/oss-security/2026/04/07/14http://www.openwall.com/lists/oss-security/2026/04/07/4http://www.openwall.com/lists/oss-security/2026/04/08/9http://www.openwall.com/lists/oss-security/2026/04/09/5http://www.openwall.com/lists/oss-security/2026/04/09/6https://access.redhat.com/errata/RHSA-2026:12423https://access.redhat.com/errata/RHSA-2026:12441https://access.redhat.com/errata/RHSA-2026:13285https://access.redhat.com/errata/RHSA-2026:14162https://access.redhat.com/errata/RHSA-2026:14937https://access.redhat.com/errata/RHSA-2026:19130https://access.redhat.com/errata/RHSA-2026:19346https://access.redhat.com/errata/RHSA-2026:19456https://access.redhat.com/errata/RHSA-2026:19458https://access.redhat.com/errata/RHSA-2026:20595https://access.redhat.com/errata/RHSA-2026:21254https://access.redhat.com/errata/RHSA-2026:21275https://access.redhat.com/errata/RHSA-2026:22634https://access.redhat.com/errata/RHSA-2026:22957https://access.redhat.com/errata/RHSA-2026:23233https://access.redhat.com/errata/RHSA-2026:23245https://access.redhat.com/errata/RHSA-2026:24346https://access.redhat.com/errata/RHSA-2026:25044https://access.redhat.com/errata/RHSA-2026:25096https://access.redhat.com/errata/RHSA-2026:25181https://access.redhat.com/errata/RHSA-2026:26542https://access.redhat.com/errata/RHSA-2026:27998https://access.redhat.com/errata/RHSA-2026:28887https://access.redhat.com/errata/RHSA-2026:29197https://access.redhat.com/errata/RHSA-2026:30078https://access.redhat.com/errata/RHSA-2026:30087https://access.redhat.com/errata/RHSA-2026:30088https://access.redhat.com/errata/RHSA-2026:30089https://access.redhat.com/errata/RHSA-2026:34098https://access.redhat.com/errata/RHSA-2026:39981https://access.redhat.com/errata/RHSA-2026:7473https://access.redhat.com/security/cve/CVE-2026-4878https://bugzilla.redhat.com/show_bug.cgi?id=2451615https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-4878.json
2026-04-09
Published