CVE-2002-0572: FreeBSD stdio File Descriptor Reuse Privilege Escalation
- Vendors
- FreebsdOpenbsdSun
CVE-2002-0572 is a local privilege escalation vulnerability affecting FreeBSD 4.5 and earlier, and possibly other BSD-derived operating systems. The issue arises when a local user closes one or more of the standard file descriptors 0, 1, or 2 (stdin, stdout, stderr) before invoking a setuid program. If the called setuid process does not safely re-open or validate these descriptors, the kernel may reuse them for subsequent file opens performed by the privileged process. As a result, I/O operations that the setuid program intended to direct to benign files or standard streams can instead be redirected to attacker-chosen files, enabling unauthorized reads from or writes to otherwise restricted files. In affected scenarios, this descriptor reuse can be leveraged to obtain elevated privileges, including root.
Impact, mitigation & remediation
What it means and what to do now: patch path, interim mitigations, and the assume-compromise checklist.
Impact
What an attacker gets, and what they’ve been doing with it.
Successful exploitation allows a local attacker to interfere with file operations performed by a setuid-root process, leading to unauthorized access to restricted files and potentially arbitrary modification of privileged resources. In practice, this can result in local privilege escalation to root and full compromise of the affected host.
Mitigation
If you can’t patch tonight, do this now.
Until patches can be applied, restrict local shell access to trusted users only, minimize the presence and use of setuid-root binaries, and monitor for suspicious local activity indicative of privilege-escalation attempts. Additional hardening of privileged programs to explicitly open or validate stdin, stdout, and stderr before use can reduce exposure.
Remediation
Patch, then assume compromise.
Apply the vendor patch referenced in FreeBSD Security Advisory FreeBSD-SA-02:23.stdio. Systems running FreeBSD 4.5 and earlier should be updated to a corrected version or patched according to the advisory guidance. Where applicable, review and harden setuid programs so they do not assume file descriptors 0, 1, and 2 are always valid and safely bound.
Exploits
No validated public exploits yet. Hidden: 1 not yet analyzed, such as Exploit-DB entries.
Affected products & vendors
Products and vendors Mallory has correlated with this vulnerability. Open in Mallory to drill down to specific CPE configurations and version ranges.
References
Frequently asked questions
- Is CVE-2002-0572 exploited in the wild?
- As of Oct 16, 2026, Mallory has no reports of CVE-2002-0572 being exploited in the wild. It is not listed in CISA KEV.
- Is there a public exploit for CVE-2002-0572?
- Yes. As of Oct 16, 2026, Mallory has reports of a public exploit for CVE-2002-0572.
- Is there a patch for CVE-2002-0572?
- Apply the vendor patch referenced in FreeBSD Security Advisory FreeBSD-SA-02:23.stdio. Systems running FreeBSD 4.5 and earlier should be updated to a corrected version or patched according to the advisory guidance.
- What products are affected by CVE-2002-0572?
- Freebsd, Openbsd, Sun Solaris, and Sunos.
- How severe is CVE-2002-0572?
- CVE-2002-0572 has a CVSS v2 score of 7.2 (High) and an EPSS score of 1.6% (76th percentile) as of Oct 16, 2026.
Recent activity
1 sources tracked across advisories and community write-ups. News coverage will land here when it surfaces.
No news coverage yet. Advisories and community discussion only.