Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-403:Exposure of File Descriptor to Unintended Control Sphere ('File Descriptor Leak')
Weakness ID:403
Version:v4.17
Weakness Name:Exposure of File Descriptor to Unintended Control Sphere ('File Descriptor Leak')
Vulnerability Mapping:Allowed
Abstraction:Base
Structure:Simple
Status:Draft
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼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.

▼Extended Description

When a new process is forked or executed, the child process inherits any open file descriptors. When the child process has fewer privileges than the parent process, this might introduce a vulnerability if the child process can access the file descriptor but does not have the privileges to access the associated file.

▼Alternate Terms
File descriptor leak

While this issue is frequently called a file descriptor leak, the "leak" term is often used in two different ways - exposure of a resource, or consumption of a resource. Use of this term could cause confusion.

▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfAllowed-with-ReviewC402Transmission of Private Resources into a New Sphere ('Resource Leak')
Nature: ChildOf
Mapping: Allowed-with-Review
Type: Class
ID: 402
Name: Transmission of Private Resources into a New Sphere ('Resource Leak')
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedC399Resource Management Errors
MemberOfProhibitedC743CERT C Secure Coding Standard (2008) Chapter 10 - Input Output (FIO)
MemberOfProhibitedC877CERT C++ Secure Coding Section 09 - Input Output (FIO)
MemberOfProhibitedC963SFP Secondary Cluster: Exposed Data
MemberOfProhibitedC1011Authorize Actors
MemberOfProhibitedC1403Comprehensive Categorization: Exposed Resource
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 399
Name: Resource Management Errors
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 743
Name: CERT C Secure Coding Standard (2008) Chapter 10 - Input Output (FIO)
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 877
Name: CERT C++ Secure Coding Section 09 - Input Output (FIO)
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 963
Name: SFP Secondary Cluster: Exposed Data
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1011
Name: Authorize Actors
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1403
Name: Comprehensive Categorization: Exposed Resource
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-294Not Language-Specific Weaknesses
MemberOfProhibitedBSBOSS-297Unix(os class) Weaknesses
MemberOfProhibitedBSBOSS-318Modify Application Data (impact)
MemberOfProhibitedBSBOSS-328Read Application Data (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-294
Name: Not Language-Specific Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-297
Name: Unix(os class) Weaknesses
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-318
Name: Modify Application Data (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-328
Name: Read Application Data (impact)
▼Relevant To View
Relevant to the view"Architectural Concepts - (1008)"
NatureMappingTypeIDName
MemberOfProhibitedC1011Authorize Actors
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 1011
Name: Authorize Actors
Relevant to the view"Software Development - (699)"
NatureMappingTypeIDName
MemberOfProhibitedC399Resource Management Errors
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 399
Name: Resource Management Errors
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC963SFP Secondary Cluster: Exposed Data
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 963
Name: SFP Secondary Cluster: Exposed Data
▼Background Detail

▼Common Consequences
ScopeLikelihoodImpactNote
ConfidentialityIntegrityN/ARead Application DataModify Application Data
N/A
Scope: Confidentiality, Integrity
Likelihood: N/A
Impact: Read Application Data, Modify Application Data
Note:
N/A
▼Potential Mitigations
▼Modes Of Introduction
Phase: Implementation
Note:

REALIZATION: This weakness is caused during implementation of an architectural security tactic.

▼Applicable Platforms
Languages
Class: C(Undetermined Prevalence)
Class: Not Language-Specific(Undetermined Prevalence)
Operating System
Class: Unix(Undetermined Prevalence)
▼Demonstrative Examples
▼Observed Examples
ReferenceDescription
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.
Reference: CVE-2003-0740
Description:
Server leaks a privileged file descriptor, allowing the server to be hijacked.
Reference: CVE-2004-1033
Description:
File descriptor leak allows read of restricted files.
Reference: CVE-2000-0094
Description:
Access to restricted resource using modified file descriptor for stderr.
Reference: CVE-2002-0638
Description:
Open file descriptor used as alternate channel in complex race condition.
Reference: CVE-2003-0489
Description:
Program does not fully drop privileges after creating a file descriptor, which allows access to the descriptor via a separate vulnerability.
Reference: CVE-2003-0937
Description:
User bypasses restrictions by obtaining a file descriptor then calling setuid program, which does not close the descriptor.
Reference: CVE-2004-2215
Description:
Terminal manager does not properly close file descriptors, allowing attackers to access terminals of other users.
Reference: CVE-2006-5397
Description:
Module opens a file for reading twice, allowing attackers to read files.
▼Affected Resources
  • System Process
  • File or Directory
▼Functional Areas
    ▼Weakness Ordinalities
    OrdinalityDescription
    ▼Detection Methods
    ▼Vulnerability Mapping Notes
    Usage:Allowed
    Reason:Acceptable-Use
    Rationale:

    This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.

    Comments:

    Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

    Suggestions:
    ▼Notes
    ▼Taxonomy Mappings
    Taxonomy NameEntry IDFitEntry Name
    PLOVERN/AN/AUNIX file descriptor leak
    CERT C Secure CodingFIO42-CN/AEnsure files are properly closed when they are no longer needed
    Software Fault PatternsSFP23N/AExposed Data
    Taxonomy Name: PLOVER
    Entry ID: N/A
    Fit: N/A
    Entry Name: UNIX file descriptor leak
    Taxonomy Name: CERT C Secure Coding
    Entry ID: FIO42-C
    Fit: N/A
    Entry Name: Ensure files are properly closed when they are no longer needed
    Taxonomy Name: Software Fault Patterns
    Entry ID: SFP23
    Fit: N/A
    Entry Name: Exposed Data
    ▼Related Attack Patterns
    IDName
    ▼References
    Reference ID: REF-392
    Title: File descriptors and setuid applications
    Author: Paul Roberts
    Section:
    Publication:
    Publisher:
    Edition:
    URL:https://blogs.oracle.com/paulr/entry/file_descriptors_and_setuid_applications
    URL Date:
    Day:05
    Month:02
    Year:2007
    Reference ID: REF-393
    Title: Introduction to Secure Coding Guide
    Author: Apple
    Section: Elevating Privileges Safely
    Publication:
    Publisher:
    Edition:
    URL:https://developer.apple.com/library/archive/documentation/Security/Conceptual/SecureCodingGuide/Articles/AccessControl.html
    URL Date:2023-04-07
    Day:N/A
    Month:N/A
    Year:N/A
    Details not found