Run static analysis (SAST) on the codebase looking for the unsafe pattern in the data flow.
Windows Shortcut Following (.LNK)
This vulnerability occurs when an application opens a file or directory without properly validating that it is a Windows shortcut (.LNK). If the shortcut's target points to a location outside the…
What is CWE-64?
Real-world CVEs caused by CWE-64
-
network access control service executes program with high privileges and allows symlink to invoke another executable or perform DLL injection.
-
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."
-
FTP server allows remote attackers to read arbitrary files and directories by uploading a .lnk (link) file that points to the target file.
-
FTP server allows remote attackers to read arbitrary files and directories by uploading a .lnk (link) file that points to the target file.
-
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.
-
".LNK." - .LNK with trailing dot
-
Rootkits can bypass file access restrictions to Windows kernel directories using NtCreateSymbolicLinkObject function to create symbolic link
Step-by-step attacker path
- 1
Identify a code path that handles untrusted input without validation.
- 2
Craft a payload that exercises the unsafe behavior — injection, traversal, overflow, or logic abuse.
- 3
Deliver the payload through a normal request and observe the application's reaction.
- 4
Iterate until the response leaks data, executes attacker code, or escalates privileges.
Vulnerable pseudo
MITRE has not published a code example for this CWE. The pattern below is illustrative — see Resources for canonical references.
// Example pattern — see MITRE for the canonical references.
function handleRequest(input) {
// Untrusted input flows directly into the sensitive sink.
return executeUnsafe(input);
} Secure pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
const safe = validateAndEscape(input);
return executeWithGuards(safe);
} How to prevent CWE-64
- Architecture and Design 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.
How to detect CWE-64
Run dynamic application security testing against the live endpoint.
Watch runtime logs for unusual exception traces, malformed input, or authorization bypass attempts.
Code review: flag any new code that handles input from this surface without using the validated framework helpers.
Plexicus auto-detects CWE-64 and opens a fix PR in under 60 seconds.
Codex Remedium scans every commit, identifies this exact weakness, and ships a reviewer-ready pull request with the patch. No tickets. No hand-offs.
Frequently asked questions
What is CWE-64?
This vulnerability occurs when an application opens a file or directory without properly validating that it is a Windows shortcut (.LNK). If the shortcut's target points to a location outside the application's intended security boundary, an attacker can trick the software into accessing unauthorized files.
How serious is CWE-64?
MITRE rates the likelihood of exploit as Low — exploitation is uncommon, but the weakness should still be fixed when discovered.
What languages or platforms are affected by CWE-64?
MITRE lists the following affected platforms: Windows.
How can I prevent CWE-64?
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.
How does Plexicus detect and fix CWE-64?
Plexicus's SAST engine matches the data-flow signature for CWE-64 on every commit. When a match is found, our Codex Remedium agent opens a fix PR with the corrected code, tests, and a one-line summary for the reviewer.
Where can I learn more about CWE-64?
MITRE publishes the canonical definition at https://cwe.mitre.org/data/definitions/64.html. You can also reference OWASP and NIST documentation for adjacent guidance.
Weaknesses related to CWE-64
Improper Link Resolution Before File Access ('Link Following')
This vulnerability occurs when an application uses a filename to access a file but fails to properly check if that name points to a…
Insecure Operation on Windows Junction / Mount Point
This vulnerability occurs when a Windows application opens a file or directory without properly validating that the path is not a symbolic…
UNIX Symbolic Link (Symlink) Following
This vulnerability occurs when a software application opens files or directories without properly checking if they are symbolic links…
UNIX Hard Link
This vulnerability occurs when an application opens a file or directory without verifying if the name points to a hard link that leads…
Windows Hard Link
This vulnerability occurs when a Windows application opens a file or directory without properly verifying if the path points to a hard…
Don't Let Security
Weigh You Down.
Stop choosing between AI velocity and security debt. Plexicus is the only platform that runs Vibe Coding Security and ASPM in parallel — one workflow, every codebase.