Incorrect reference resolution in FileSystem (CVE-2026-113102)
A logic flaw in the IsHiddenItem function on POSIX systems only checks if the final path component is a symbolic link, allowing an attacker to bypass symbolic link traversal protections in Isolated File Systems. By providing a path with an intermediate symbolic link, an attacker could potentially read arbitrary files outside the intended restricted directory.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 7 months
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: A logic flaw in LocalFileUtil::IsHiddenItem on POSIX systems may allow an attacker to bypass symbolic link traversal protections in Isolated File Systems. By constructing a path with an intermediate symbolic link, an attacker could potentially read arbitrary files outside the intended restricted directory.
Affected files:
storage/browser/file_system/local_file_util.ccstorage/browser/file_system/dragged_file_util.ccbase/files/file_util_posix.cc
Estimated timestamp from git blame: 2024-05-03
Description
A potential logic flaw in storage/browser/file_system/local_file_util.cc on POSIX systems allows an attacker to bypass symbolic link traversal protections in Isolated File Systems (such as those created when a user drags and drops a folder into the browser).
The LocalFileUtil::IsHiddenItem method is intended to prevent access to symbolic links within these systems, as they could be used to escape the restricted directory. However, its implementation on POSIX only checks if the final component of a path is a symbolic link.
Specifically, IsHiddenItem calls base::IsLink(), which in turn uses lstat() on the provided platform path. On POSIX, lstat() resolves all intermediate symbolic links in a path and only refuses to dereference the final component.
If an attacker provides a path where an intermediate directory is a symbolic link (e.g., link/sensitive_file, where link points to /home/user), lstat() resolves the intermediate link and retrieves the status of sensitive_file. Since sensitive_file itself is a regular file and not a link, the base::IsLink() check returns false, and the security check passes.
The browser process subsequently opens the file using the full path, which naturally follows the intermediate symbolic link, granting access to the file outside the dropped directory.
Potential Attack Scenario
(Note: These are suggested steps based on code analysis; a full working exploit has not been executed.)
- An attacker provides an archive (e.g., a
.tarfile) containing a symbolic link to a sensitive location (e.g.,ln -s /home/victim /tmp/bait/link). - The victim extracts the archive on a POSIX-compliant system. Extraction tools typically preserve symbolic links.
- The victim is socially engineered into dragging the extracted directory onto the attacker's website.
- The website's script calls
entry.getFile('link/.ssh/id_rsa', {}, successCallback), using the known symbolic link namelinkfrom the provided archive. - In the browser process,
LocalFileUtil::GetFileInfois called for the resolved platform path (e.g.,/tmp/bait/link/.ssh/id_rsa). IsHiddenItemcallsbase::IsLink(), which callslstat().lstat()resolves the intermediatelinkand reports the status of the target file (id_rsa). Since the target is a regular file,IsHiddenItemreturnsfalse.- The browser process considers the file safe and grants the renderer process read access to the path, allowing the attacker to read the victim's private data.
Vulnerable Code
In storage/browser/file_system/local_file_util.cc:
273: bool LocalFileUtil::IsHiddenItem(const base::FilePath& local_file_path) const {
274: // We should not follow symbolic links in sandboxed file system.
275: return base::IsLink(local_file_path);
276: }
In base/files/file_util_posix.cc:
1030: bool IsLink(const FilePath& file_path) {
1031: stat_wrapper_t st;
1032: if (File::Lstat(file_path, &st) != 0) {
1033: return false;
1034: }
1035: return S_ISLNK(st.st_mode);
1036: }
Suggested Fix
LocalFileUtil::IsHiddenItem should ensure that no component of the path is a symbolic link. On POSIX, this can be achieved by using base::MakeAbsoluteFilePath (which resolves all symlinks using realpath) and verifying that the resulting resolved path does not diverge from the expected normalized path (or ensuring that the resolved path still resides strictly within the bounds of the isolated file system's root). Alternatively, base::IsLink could be updated or a new utility function introduced to check all path components iteratively.
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the IsHiddenItem function uses lstat() which resolves intermediate symbolic links, so it only detects if the final component is a link, not any intermediate ones.
Impact
An attacker could potentially read arbitrary files outside the intended restricted directory, such as the victim's private data.
What the attacker needed
Victim extracts a malicious archive; victim drags folder onto attacker's site; POSIX-compliant system
The fix
The fix should ensure that no component of the path is a symbolic link, for example by using base::MakeAbsoluteFilePath to resolve all symlinks and verifying the resolved path stays within the isolated file system's root.
How it was found
- An attacker provides an archive containing a symbolic link to a sensitive location.
- The victim extracts the archive on a POSIX-compliant system, preserving the symbolic link.
- The victim is socially engineered into dragging the extracted directory onto the attacker's website.
- The website's script calls entry.getFile with a path that includes the symbolic link.
- The browser process calls IsHiddenItem, which uses lstat() and returns false because the final component is a regular file.
- The browser grants read access to the file outside the dropped directory.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
A symbolic link is like a shortcut that points to another file or folder. The browser tries to block shortcuts inside folders you drag into it, because they could lead to private files. But the check only looks at the last part of the path, so if a shortcut is in the middle of the path, the browser follows it and lets the attacker read files outside the folder.
What is Path traversal?
Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.