Logo
-

Byte Open Security

(ByteOS Network)

Log In

Sign Up

ByteOS

Security
Vulnerability Details
Registries
Custom Views
Weaknesses
Attack Patterns
Filters & Tools
CWE-62:UNIX Hard Link
Weakness ID:62
Version:v4.17
Weakness Name:UNIX Hard Link
Vulnerability Mapping:Allowed
Abstraction:Variant
Structure:Simple
Status:Incomplete
Likelihood of Exploit:
DetailsContent HistoryObserved CVE ExamplesReports
▼Description

The product, when opening a file or directory, does not sufficiently account for when the name is associated with a hard link to a target that is outside of the intended control sphere. This could allow an attacker to cause the product to operate on unauthorized files.

▼Extended Description

Failure for a system to check for hard links can result in vulnerability to different types of attacks. For example, an attacker can escalate their privileges if a file used by a privileged program is replaced with a hard link to a sensitive file (e.g. /etc/passwd). When the process opens the file, the attacker can assume the privileges of that process.

▼Alternate Terms
▼Relationships
Relevant to the view"Research Concepts - (1000)"
NatureMappingTypeIDName
ChildOfAllowedB59Improper Link Resolution Before File Access ('Link Following')
Nature: ChildOf
Mapping: Allowed
Type: Base
ID: 59
Name: Improper Link Resolution Before File Access ('Link Following')
▼Memberships
NatureMappingTypeIDName
MemberOfProhibitedC743CERT C Secure Coding Standard (2008) Chapter 10 - Input Output (FIO)
MemberOfProhibitedC877CERT C++ Secure Coding Section 09 - Input Output (FIO)
MemberOfProhibitedC980SFP Secondary Cluster: Link in Resource Name Resolution
MemberOfProhibitedC1404Comprehensive Categorization: File Handling
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: 980
Name: SFP Secondary Cluster: Link in Resource Name Resolution
Nature: MemberOf
Mapping: Prohibited
Type:Category
ID: 1404
Name: Comprehensive Categorization: File Handling
▼Tags
NatureMappingTypeIDName
MemberOfProhibitedBSBOSS-280Separation of Privilege Strategy
MemberOfProhibitedBSBOSS-294Not Language-Specific Weaknesses
MemberOfProhibitedBSBOSS-297Unix(os class) Weaknesses
MemberOfProhibitedBSBOSS-319Read Files or Directories (impact)
MemberOfProhibitedBSBOSS-320Modify Files or Directories (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-280
Name: Separation of Privilege Strategy
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-319
Name: Read Files or Directories (impact)
Nature: MemberOf
Mapping: Prohibited
Type:BOSSView
ID: BOSS-320
Name: Modify Files or Directories (impact)
▼Relevant To View
Relevant to the view"Software Fault Pattern (SFP) Clusters - (888)"
NatureMappingTypeIDName
MemberOfProhibitedC980SFP Secondary Cluster: Link in Resource Name Resolution
Nature: MemberOf
Mapping: Prohibited
Type: Category
ID: 980
Name: SFP Secondary Cluster: Link in Resource Name Resolution
▼Background Detail

▼Common Consequences
ScopeLikelihoodImpactNote
ConfidentialityIntegrityN/ARead Files or DirectoriesModify Files or Directories
N/A
Scope: Confidentiality, Integrity
Likelihood: N/A
Impact: Read Files or Directories, Modify Files or Directories
Note:
N/A
▼Potential Mitigations
Phase:Architecture and Design
Mitigation ID: MIT-48.1
Strategy: Separation of Privilege
Effectiveness:
Description:

Follow the principle of least privilege when assigning access rights to entities in a software system.

Denying access to a file can prevent an attacker from replacing that file with a link to a sensitive file. Ensure good compartmentalization in the system to provide protected areas that can be trusted.

Note:

▼Modes Of Introduction
Phase: Implementation
Note:

N/A

▼Applicable Platforms
Languages
Class: Not Language-Specific(Undetermined Prevalence)
Operating System
Class: Unix(Undetermined Prevalence)
▼Demonstrative Examples
▼Observed Examples
ReferenceDescription
CVE-2001-1494
Hard link attack, file overwrite; interesting because program checks against soft links
CVE-2002-0793
Hard link and possibly symbolic link following vulnerabilities in embedded operating system allow local users to overwrite arbitrary files.
CVE-2003-0578
Server creates hard links and unlinks files as root, which allows local users to gain privileges by deleting and overwriting arbitrary files.
CVE-1999-0783
Operating system allows local users to conduct a denial of service by creating a hard link from a device special file to a file on an NFS file system.
CVE-2004-1603
Web hosting manager follows hard links, which allows local users to read or modify arbitrary files.
CVE-2004-1901
Package listing system allows local users to overwrite arbitrary files via a hard link attack on the lockfiles.
CVE-2005-0342
The Finder in Mac OS X and earlier allows local users to overwrite arbitrary files and gain privileges by creating a hard link from the .DS_Store file to an arbitrary file.
CVE-2005-1111
Hard link race condition
CVE-2021-21272
"Zip Slip" vulnerability in Go-based Open Container Initiative (OCI) registries product allows writing arbitrary files outside intended directory via symbolic links or hard links in a gzipped tarball.
CVE-2003-1366
setuid root tool allows attackers to read secret data by replacing a temp file with a hard link to a sensitive file
Reference: CVE-2001-1494
Description:
Hard link attack, file overwrite; interesting because program checks against soft links
Reference: CVE-2002-0793
Description:
Hard link and possibly symbolic link following vulnerabilities in embedded operating system allow local users to overwrite arbitrary files.
Reference: CVE-2003-0578
Description:
Server creates hard links and unlinks files as root, which allows local users to gain privileges by deleting and overwriting arbitrary files.
Reference: CVE-1999-0783
Description:
Operating system allows local users to conduct a denial of service by creating a hard link from a device special file to a file on an NFS file system.
Reference: CVE-2004-1603
Description:
Web hosting manager follows hard links, which allows local users to read or modify arbitrary files.
Reference: CVE-2004-1901
Description:
Package listing system allows local users to overwrite arbitrary files via a hard link attack on the lockfiles.
Reference: CVE-2005-0342
Description:
The Finder in Mac OS X and earlier allows local users to overwrite arbitrary files and gain privileges by creating a hard link from the .DS_Store file to an arbitrary file.
Reference: CVE-2005-1111
Description:
Hard link race condition
Reference: CVE-2021-21272
Description:
"Zip Slip" vulnerability in Go-based Open Container Initiative (OCI) registries product allows writing arbitrary files outside intended directory via symbolic links or hard links in a gzipped tarball.
Reference: CVE-2003-1366
Description:
setuid root tool allows attackers to read secret data by replacing a temp file with a hard link to a sensitive file
▼Affected Resources
    ▼Functional Areas
      ▼Weakness Ordinalities
      OrdinalityDescription
      Resultant
      N/A
      Ordinality: Resultant
      Description:
      N/A
      ▼Detection Methods
      ▼Vulnerability Mapping Notes
      Usage:Allowed
      Reason:Acceptable-Use
      Rationale:

      This CWE entry is at the Variant 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 hard link
      CERT C Secure CodingFIO05-CN/AIdentify files using multiple file attributes
      Software Fault PatternsSFP18N/ALink in resource name resolution
      Taxonomy Name: PLOVER
      Entry ID: N/A
      Fit: N/A
      Entry Name: UNIX hard link
      Taxonomy Name: CERT C Secure Coding
      Entry ID: FIO05-C
      Fit: N/A
      Entry Name: Identify files using multiple file attributes
      Taxonomy Name: Software Fault Patterns
      Entry ID: SFP18
      Fit: N/A
      Entry Name: Link in resource name resolution
      ▼Related Attack Patterns
      IDName
      ▼References
      Reference ID: REF-62
      Title: The Art of Software Security Assessment
      Author: Mark Dowd, John McDonald, Justin Schuh
      Section: Chapter 9, "Hard Links", Page 518
      Publication:
      Publisher:Addison Wesley
      Edition:1st Edition
      URL:
      URL Date:
      Day:N/A
      Month:N/A
      Year:2006
      Details not found