CWEweakness

CWE-403 Exposure of File Descriptor to Unintended Control Sphere

Official page ↗
Alternate terms
File descriptor leak
Abstraction
Base
Structure
Simple
Status
Draft
Languages
C, Not Language-Specific
CWE version
5.0

Description

A process does not close sensitive file descriptors before invoking a child process, which allows the child to perform unauthorized I/O operations using those descriptors.

Common consequences

• Confidentiality, Integrity: Read Application Data, Modify Application Data

Detection methods

• Automated Static Analysis: Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Observed examples

• CVE-2003-0740: Server leaks a privileged file descriptor, allowing the server to be hijacked. • CVE-2004-1033: File descriptor leak allows read of restricted files. • CVE-2000-0094: Access to restricted resource using modified file descriptor for stderr. • CVE-2002-0638: Open file descriptor used as alternate channel in complex race condition. • CVE-2003-0489: Program does not fully drop privileges after creating a file descriptor, which allows access to the descriptor via a separate vulnerability. • CVE-2003-0937: User bypasses restrictions by obtaining a file descriptor then calling setuid program, which does not close the descriptor. • CVE-2004-2215: Terminal manager does not properly close file descriptors, allowing attackers to access terminals of other users. • CVE-2006-5397: Module opens a file for reading twice, allowing attackers to read files.

Related

Observed example · CVE (8)

  • CVE-2006-5397 The Xinput module (modules/im/ximcp/imLcIm.c) in X.Org libX11 1.0.2 and 1.0.3 opens a file for reading twice using the same file… vulnerability
  • CVE-2004-1033 Fcron 2.0.1, 2.9.4, and possibly earlier versions leak file descriptors of open files, which allows local users to bypass access… vulnerability
  • CVE-2004-2215 RXVT-Unicode 3.4 and 3.5 does not properly close file descriptors, which allows local users to access the terminals of other users and… vulnerability
  • CVE-2003-0937 SCO UnixWare 7.1.1, 7.1.3, and Open UNIX 8.0.0 allows local users to bypass protections for the "as" address space file for a process ID… vulnerability
  • CVE-2003-0740 Stunnel 4.00, and 3.24 and earlier, leaks a privileged file descriptor returned by listen(), which allows local users to hijack the Stunnel… vulnerability
  • CVE-2003-0489 tcptraceroute 1.4 and earlier does not fully drop privileges after obtaining a file descriptor for capturing packets, which may allow local… vulnerability
  • CVE-2002-0638 setpwnam.c in the util-linux package, as included in Red Hat Linux 7.3 and earlier, and other operating systems, does not properly lock a… vulnerability
  • CVE-2000-0094 procfs in BSD systems allows local users to gain root privileges by modifying the /proc/pid/mem interface via a modified file descriptor… vulnerability

Child of · CWE (1)

  • CWE-402 Transmission of Private Resources into a New Sphere weakness

Referenced by CVE · weakness (8)

  • CVE-2026-33263 When mail_max_userip_connections is set (default 10) and reached, submission-login can crash with epoll() panic caused by file descriptor… vulnerability
  • CVE-2026-16526 A flaw in the PCP linux_sockets module exposes an unsecured internal connection. vulnerability
  • CVE-2026-12296 Sandbox escape in the Security: Process Sandboxing component. vulnerability
  • CVE-2026-40042 Pachno 1.0.6 contains an XML external entity injection vulnerability that allows unauthenticated attackers to read arbitrary files by… vulnerability
  • CVE-2025-15114 Ksenia Security lares (legacy model) Home Automation version 1.6 contains a critical security flaw that exposes the alarm system PIN in the… vulnerability
  • CVE-2024-58280 CMSimple 5.15 contains a remote command execution vulnerability that allows authenticated attackers to modify file extensions and upload… vulnerability
  • CVE-2025-3032 Leaking of file descriptors from the fork server to web content processes could allow for privilege escalation attacks. vulnerability
  • CVE-2024-21626 runc is a CLI tool for spawning and running containers on Linux according to the OCI specification. vulnerability