{"@ID": "59", "@Name": "Improper Link Resolution Before File Access ('Link Following')", "@Abstraction": "Base", "@Structure": "Simple", "@Status": "Draft", "Description": "The product attempts to access a file based on the filename, but it does not properly prevent that filename from identifying a link or shortcut that resolves to an unintended resource.", "Related_Weaknesses": {"Related_Weakness": [{"@Nature": "ChildOf", "@CWE_ID": "706", "@View_ID": "1000", "@Ordinal": "Primary"}, {"@Nature": "ChildOf", "@CWE_ID": "706", "@View_ID": "1003", "@Ordinal": "Primary"}]}, "Weakness_Ordinalities": {"Weakness_Ordinality": {"Ordinality": "Resultant"}}, "Applicable_Platforms": {"Language": {"@Class": "Not Language-Specific", "@Prevalence": "Undetermined"}, "Operating_System": [{"@Class": "Windows", "@Prevalence": "Sometimes"}, {"@Class": "Unix", "@Prevalence": "Often"}], "Technology": {"@Class": "Not Technology-Specific", "@Prevalence": "Undetermined"}}, "Background_Details": {"Background_Detail": "Soft links are a UNIX term that is synonymous with simple shortcuts on Windows-based platforms."}, "Alternate_Terms": {"Alternate_Term": [{"Term": "insecure temporary file", "Description": "Some people use the phrase \"insecure temporary file\" when referring to a link following weakness, but other weaknesses can produce insecure temporary files without any symlink involvement at all."}, {"Term": "Zip Slip", "Description": "\"Zip slip\" is an attack that uses file archives (e.g., ZIP, tar, rar, etc.) that contain filenames with path traversal sequences that cause the files to be written outside of the directory under which the archive is expected to be extracted [REF-1282]. It is most commonly used for relative path traversal (CWE-23) and link following (CWE-59)."}]}, "Modes_Of_Introduction": {"Introduction": {"Phase": "Implementation", "Note": "REALIZATION: This weakness is caused during implementation of an architectural security tactic."}}, "Likelihood_Of_Exploit": "Medium", "Common_Consequences": {"Consequence": [{"Scope": ["Confidentiality", "Integrity", "Access Control"], "Impact": ["Read Files or Directories", "Modify Files or Directories", "Bypass Protection Mechanism"], "Note": "An attacker may be able to traverse the file system to unintended locations and read or overwrite the contents of unexpected files. If the files are used for a security mechanism then an attacker may be able to bypass the mechanism."}, {"Scope": "Other", "Impact": "Execute Unauthorized Code or Commands", "Note": "Windows simple shortcuts, sometimes referred to as soft links, can be exploited remotely since a \".LNK\" file can be uploaded like a normal file. This can enable remote execution."}]}, "Detection_Methods": {"Detection_Method": [{"Method": "Automated Static Analysis - Binary or Bytecode", "Description": {"xhtml:p": "According to SOAR [REF-1479], the following detection techniques may be useful:", "xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": "Cost effective for partial coverage:", "xhtml:ul": {"xhtml:li": "Bytecode Weakness Analysis - including disassembler + source code weakness analysis"}}}, "Effectiveness": "SOAR Partial"}, {"Method": "Manual Static Analysis - Binary or Bytecode", "Description": {"xhtml:p": "According to SOAR [REF-1479], the following detection techniques may be useful:", "xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": "Cost effective for partial coverage:", "xhtml:ul": {"xhtml:li": "Binary / Bytecode disassembler - then use manual analysis for vulnerabilities & anomalies"}}}, "Effectiveness": "SOAR Partial"}, {"Method": "Dynamic Analysis with Automated Results Interpretation", "Description": {"xhtml:p": "According to SOAR [REF-1479], the following detection techniques may be useful:", "xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": "Cost effective for partial coverage:", "xhtml:ul": {"xhtml:li": ["Web Application Scanner", "Web Services Scanner", "Database Scanners"]}}}, "Effectiveness": "SOAR Partial"}, {"Method": "Dynamic Analysis with Manual Results Interpretation", "Description": {"xhtml:p": "According to SOAR [REF-1479], the following detection techniques may be useful:", "xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": "Cost effective for partial coverage:", "xhtml:ul": {"xhtml:li": ["Fuzz Tester", "Framework-based Fuzzer"]}}}, "Effectiveness": "SOAR Partial"}, {"Method": "Manual Static Analysis - Source Code", "Description": {"xhtml:p": "According to SOAR [REF-1479], the following detection techniques may be useful:", "xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": "Highly cost effective:", "xhtml:ul": {"xhtml:li": ["Focused Manual Spotcheck - Focused manual analysis of source", "Manual Source Code Review (not inspections)"]}}}, "Effectiveness": "High"}, {"Method": "Automated Static Analysis - Source Code", "Description": {"xhtml:p": "According to SOAR [REF-1479], the following detection techniques may be useful:", "xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": "Cost effective for partial coverage:", "xhtml:ul": {"xhtml:li": ["Source code Weakness Analyzer", "Context-configured Source Code Weakness Analyzer"]}}}, "Effectiveness": "SOAR Partial"}, {"Method": "Architecture or Design Review", "Description": {"xhtml:p": "According to SOAR [REF-1479], the following detection techniques may be useful:", "xhtml:div": {"@style": "margin-left:1em;", "xhtml:div": ["Highly cost effective:", "Cost effective for partial coverage:"], "xhtml:ul": [{"xhtml:li": "Formal Methods / Correct-By-Construction"}, {"xhtml:li": "Inspection (IEEE 1028 standard) (can apply to requirements, design, source code, etc.)"}]}}, "Effectiveness": "High"}]}, "Potential_Mitigations": {"Mitigation": {"@Mitigation_ID": "MIT-48.1", "Phase": "Architecture and Design", "Strategy": "Separation of Privilege", "Description": {"xhtml:p": ["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."]}}}, "Observed_Examples": {"Observed_Example": [{"Reference": "CVE-1999-1386", "Description": "Some versions of Perl follow symbolic links when running with the -e option, which allows local users to overwrite arbitrary files via a symlink attack.", "Link": "https://www.cve.org/CVERecord?id=CVE-1999-1386"}, {"Reference": "CVE-2000-1178", "Description": "Text editor follows symbolic links when creating a rescue copy during an abnormal exit, which allows local users to overwrite the files of other users.", "Link": "https://www.cve.org/CVERecord?id=CVE-2000-1178"}, {"Reference": "CVE-2004-0217", "Description": "Antivirus update allows local users to create or append to arbitrary files via a symlink attack on a logfile.", "Link": "https://www.cve.org/CVERecord?id=CVE-2004-0217"}, {"Reference": "CVE-2003-0517", "Description": "Symlink attack allows local users to overwrite files.", "Link": "https://www.cve.org/CVERecord?id=CVE-2003-0517"}, {"Reference": "CVE-2004-0689", "Description": "Window manager does not properly handle when certain symbolic links point to \"stale\" locations, which could allow local users to create or truncate arbitrary files.", "Link": "https://www.cve.org/CVERecord?id=CVE-2004-0689"}, {"Reference": "CVE-2005-1879", "Description": "Second-order symlink vulnerabilities", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-1879"}, {"Reference": "CVE-2005-1880", "Description": "Second-order symlink vulnerabilities", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-1880"}, {"Reference": "CVE-2005-1916", "Description": "Symlink in Python program", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-1916"}, {"Reference": "CVE-2000-0972", "Description": "Setuid product allows file reading by replacing a file being edited with a symlink to the targeted file, leaking the result in error messages when parsing fails.", "Link": "https://www.cve.org/CVERecord?id=CVE-2000-0972"}, {"Reference": "CVE-2005-0824", "Description": "Signal causes a dump that follows symlinks.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-0824"}, {"Reference": "CVE-2001-1494", "Description": "Hard link attack, file overwrite; interesting because program checks against soft links", "Link": "https://www.cve.org/CVERecord?id=CVE-2001-1494"}, {"Reference": "CVE-2002-0793", "Description": "Hard link and possibly symbolic link following vulnerabilities in embedded operating system allow local users to overwrite arbitrary files.", "Link": "https://www.cve.org/CVERecord?id=CVE-2002-0793"}, {"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.", "Link": "https://www.cve.org/CVERecord?id=CVE-2003-0578"}, {"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.", "Link": "https://www.cve.org/CVERecord?id=CVE-1999-0783"}, {"Reference": "CVE-2004-1603", "Description": "Web hosting manager follows hard links, which allows local users to read or modify arbitrary files.", "Link": "https://www.cve.org/CVERecord?id=CVE-2004-1603"}, {"Reference": "CVE-2004-1901", "Description": "Package listing system allows local users to overwrite arbitrary files via a hard link attack on the lockfiles.", "Link": "https://www.cve.org/CVERecord?id=CVE-2004-1901"}, {"Reference": "CVE-2005-1111", "Description": "Hard link race condition", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-1111"}, {"Reference": "CVE-2000-0342", "Description": "Mail client allows remote attackers to bypass the user warning for executable attachments such as .exe, .com, and .bat by using a .lnk file that refers to the attachment, aka \"Stealth Attachment.\"", "Link": "https://www.cve.org/CVERecord?id=CVE-2000-0342"}, {"Reference": "CVE-2001-1042", "Description": "FTP server allows remote attackers to read arbitrary files and directories by uploading a .lnk (link) file that points to the target file.", "Link": "https://www.cve.org/CVERecord?id=CVE-2001-1042"}, {"Reference": "CVE-2001-1043", "Description": "FTP server allows remote attackers to read arbitrary files and directories by uploading a .lnk (link) file that points to the target file.", "Link": "https://www.cve.org/CVERecord?id=CVE-2001-1043"}, {"Reference": "CVE-2005-0587", "Description": "Browser allows remote malicious web sites to overwrite arbitrary files by tricking the user into downloading a .LNK (link) file twice, which overwrites the file that was referenced in the first .LNK file.", "Link": "https://www.cve.org/CVERecord?id=CVE-2005-0587"}, {"Reference": "CVE-2001-1386", "Description": "\".LNK.\" - .LNK with trailing dot", "Link": "https://www.cve.org/CVERecord?id=CVE-2001-1386"}, {"Reference": "CVE-2003-1233", "Description": "Rootkits can bypass file access restrictions to Windows kernel directories using NtCreateSymbolicLinkObject function to create symbolic link", "Link": "https://www.cve.org/CVERecord?id=CVE-2003-1233"}, {"Reference": "CVE-2002-0725", "Description": "File system allows local attackers to hide file usage activities via a hard link to the target file, which causes the link to be recorded in the audit trail instead of the target file.", "Link": "https://www.cve.org/CVERecord?id=CVE-2002-0725"}, {"Reference": "CVE-2003-0844", "Description": "Web server plugin allows local users to overwrite arbitrary files via a symlink attack on predictable temporary filenames.", "Link": "https://www.cve.org/CVERecord?id=CVE-2003-0844"}, {"Reference": "CVE-2015-3629", "Description": "A Libcontainer used in Docker Engine allows local users to escape containerization and write to an arbitrary file on the host system via a symlink attack in an image when respawning a container.", "Link": "https://www.cve.org/CVERecord?id=CVE-2015-3629"}, {"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.", "Link": "https://www.cve.org/CVERecord?id=CVE-2021-21272"}, {"Reference": "CVE-2020-27833", "Description": "\"Zip Slip\" vulnerability in container management product allows writing arbitrary files outside intended directory via a container image (.tar format) with filenames that are symbolic links that point to other files within the same tar file; however, the files being pointed to can also be symbolic links to destinations outside the intended directory, bypassing the initial check.", "Link": "https://www.cve.org/CVERecord?id=CVE-2020-27833"}]}, "Functional_Areas": {"Functional_Area": "File Processing"}, "Affected_Resources": {"Affected_Resource": "File or Directory"}, "Taxonomy_Mappings": {"Taxonomy_Mapping": [{"@Taxonomy_Name": "PLOVER", "Entry_Name": "Link Following"}, {"@Taxonomy_Name": "CERT C Secure Coding", "Entry_ID": "FIO02-C", "Entry_Name": "Canonicalize path names originating from untrusted sources"}, {"@Taxonomy_Name": "CERT C Secure Coding", "Entry_ID": "POS01-C", "Entry_Name": "Check for the existence of links when dealing with files"}, {"@Taxonomy_Name": "SEI CERT Perl Coding Standard", "Entry_ID": "FIO01-PL", "Entry_Name": "Do not operate on files that can be modified by untrusted users", "Mapping_Fit": "CWE More Specific"}, {"@Taxonomy_Name": "Software Fault Patterns", "Entry_ID": "SFP18", "Entry_Name": "Link in resource name resolution"}]}, "Related_Attack_Patterns": {"Related_Attack_Pattern": [{"@CAPEC_ID": "132"}, {"@CAPEC_ID": "17"}, {"@CAPEC_ID": "35"}, {"@CAPEC_ID": "76"}]}, "References": {"Reference": [{"@External_Reference_ID": "REF-62", "@Section": "Chapter 9, \"Symbolic Link Attacks\", Page 518"}, {"@External_Reference_ID": "REF-1282"}, {"@External_Reference_ID": "REF-1479"}]}, "Mapping_Notes": {"Usage": "Allowed", "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.", "Reasons": {"Reason": {"@Type": "Acceptable-Use"}}}, "Notes": {"Note": {"@Type": "Theoretical", "xhtml:p": ["Link following vulnerabilities are Multi-factor Vulnerabilities (MFV). They are the combination of multiple elements: file or directory permissions, filename predictability, race conditions, and in some cases, a design limitation in which there is no mechanism for performing atomic file creation operations.", "Some potential factors are race conditions, permissions, and predictability."]}}, "Content_History": {"Submission": {"Submission_Name": "PLOVER", "Submission_Date": "2006-07-19", "Submission_Version": "Draft 3", "Submission_ReleaseDate": "2006-07-19"}, "Modification": [{"Modification_Name": "Eric Dalci", "Modification_Organization": "Cigital", "Modification_Date": "2008-07-01", "Modification_Version": "1.0", "Modification_ReleaseDate": "2008-09-09", "Modification_Comment": "updated Time_of_Introduction"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2008-09-08", "Modification_Version": "1.0", "Modification_ReleaseDate": "2008-09-09", "Modification_Comment": "updated Alternate_Terms, Applicable_Platforms, Relationships, Other_Notes, Relationship_Notes, Taxonomy_Mappings, Weakness_Ordinalities"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2008-11-24", "Modification_Version": "1.1", "Modification_ReleaseDate": "2008-11-25", "Modification_Comment": "updated Relationships, Taxonomy_Mappings"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2009-01-12", "Modification_Version": "1.2", "Modification_ReleaseDate": "2009-01-12", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2009-05-27", "Modification_Version": "1.4", "Modification_ReleaseDate": "2009-05-27", "Modification_Comment": "updated Description, Name"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2009-10-29", "Modification_Version": "1.6", "Modification_ReleaseDate": "2009-10-29", "Modification_Comment": "updated Background_Details, Other_Notes"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2010-02-16", "Modification_Version": "1.8", "Modification_ReleaseDate": "2010-02-16", "Modification_Comment": "updated Potential_Mitigations, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2010-04-05", "Modification_Version": "1.8.1", "Modification_ReleaseDate": "2010-04-05", "Modification_Comment": "updated Related_Attack_Patterns"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2011-06-01", "Modification_Version": "1.13", "Modification_ReleaseDate": "2011-06-01", "Modification_Comment": "updated Common_Consequences"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2011-09-13", "Modification_Version": "2.1", "Modification_ReleaseDate": "2011-09-13", "Modification_Comment": "updated Relationships, Taxonomy_Mappings"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2012-05-11", "Modification_Version": "2.2", "Modification_ReleaseDate": "2012-05-15", "Modification_Comment": "updated Common_Consequences, Observed_Examples, References, Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2012-10-30", "Modification_Version": "2.3", "Modification_ReleaseDate": "2012-10-30", "Modification_Comment": "updated Potential_Mitigations"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2014-06-23", "Modification_Version": "2.7", "Modification_ReleaseDate": "2014-06-23", "Modification_Comment": "updated Common_Consequences, Other_Notes"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2014-07-30", "Modification_Version": "2.8", "Modification_ReleaseDate": "2014-07-31", "Modification_Comment": "updated Detection_Factors, Relationships, Taxonomy_Mappings"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2015-12-07", "Modification_Version": "2.9", "Modification_ReleaseDate": "2015-12-07", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2017-11-08", "Modification_Version": "3.0", "Modification_ReleaseDate": "2017-11-08", "Modification_Comment": "updated Affected_Resources, Applicable_Platforms, Causal_Nature, Common_Consequences, Functional_Areas, Likelihood_of_Exploit, Modes_of_Introduction, Relationships, Taxonomy_Mappings"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2019-01-03", "Modification_Version": "3.2", "Modification_ReleaseDate": "2019-01-03", "Modification_Comment": "updated Taxonomy_Mappings"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2019-06-20", "Modification_Version": "3.3", "Modification_ReleaseDate": "2019-06-20", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2020-02-24", "Modification_Version": "4.0", "Modification_ReleaseDate": "2020-02-24", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2021-03-15", "Modification_Version": "4.4", "Modification_ReleaseDate": "2021-03-15", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2021-10-28", "Modification_Version": "4.6", "Modification_ReleaseDate": "2021-10-28", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2022-04-28", "Modification_Version": "4.7", "Modification_ReleaseDate": "2022-04-28", "Modification_Comment": "updated Research_Gaps"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2022-06-28", "Modification_Version": "4.8", "Modification_ReleaseDate": "2022-06-28", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2022-10-13", "Modification_Version": "4.9", "Modification_ReleaseDate": "2022-10-13", "Modification_Comment": "updated Alternate_Terms, Background_Details, Observed_Examples, References, Relationship_Notes, Theoretical_Notes"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2023-01-31", "Modification_Version": "4.10", "Modification_ReleaseDate": "2023-01-31", "Modification_Comment": "updated Description"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2023-04-27", "Modification_Version": "4.11", "Modification_ReleaseDate": "2023-04-27", "Modification_Comment": "updated Relationships"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2023-06-29", "Modification_Version": "4.12", "Modification_ReleaseDate": "2023-06-29", "Modification_Comment": "updated Mapping_Notes"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2025-09-09", "Modification_Version": "4.18", "Modification_ReleaseDate": "2025-09-09", "Modification_Comment": "updated Detection_Factors, References"}, {"Modification_Name": "CWE Content Team", "Modification_Organization": "MITRE", "Modification_Date": "2025-12-11", "Modification_Version": "4.19", "Modification_ReleaseDate": "2025-12-11", "Modification_Comment": "updated Applicable_Platforms, Relationships"}], "Previous_Entry_Name": [{"@Date": "2008-04-11", "#text": "Link Following"}, {"@Date": "2009-05-27", "#text": "Failure to Resolve Links Before File Access (aka 'Link Following')"}]}}
