Compromised content process → Firefox command-line argument injection via taskbar jumplist poisoning (Windows)
A compromised Firefox content process could send a forged visit URI with raw spaces and an injected command-line flag, which the parent stored unvalidated in history. The Windows taskbar jumplist then built a firefox.exe shortcut using that raw URL as unescaped arguments, so a user click on a spoofed item launched Firefox with the injected flag and deleted a directory.
Originally disclosed on Mozilla
- Fixed in 30 days
- Paid in 3 months
- Disclosed after 30 days
Created attachment 9605675 poc.zip
Summary
A compromised content process calls SendVisitURI with a forged nsIURI whose spec carries raw spaces and an
injected flag (e.g. C:\Users\<user> Documents 2 --backgroundtask removeDirectory); the parent stores it
verbatim in moz_places.url. The Windows taskbar jumplist "Frequent" list then builds a firefox.exe
shortcut whose arguments are that raw URL, unescaped, and the attacker sets the entry's title (via the
unvalidated SetURITitle IPC) so the item reads "Google". On click, Windows splits the string into argv and
the injected flag runs — --backgroundtask removeDirectory <path> deletes a directory (space-free path
components) as a fresh, unsandboxed process at full user privilege: a content→parent sandbox escape.
Verification status: demonstrated end-to-end on a published Firefox Nightly (BuildID 20260707211043) on
real Windows 10 Pro — Firefox's own WinTaskbarJumpList.buildList() serialized the poisoned shortcut into the
real jumplist file, and a literal hands-free taskbar mouse-click on the spoofed "Google" item performed the
deletion. Only content→moz_places (defects A+B) is stood in by a DB seed on Windows; it is separately
confirmed on Linux with an unmodified parent. No ASAN (logic chain). PoC + logs in poc/.
Affects
- Version: Firefox Nightly 154.0a1, changeset 969c51e9686e864a47b977883af8a4af0b03206c, BuildID 20260707211043.
- Component: Firefox :: Shell Integration (jumplist) + Toolkit :: Places (history storage) + Core :: DOM: Content Processes (
RecvVisitURI). - Threat model: compromised/hostile content process forging IPC to the parent (standard post-renderer-RCE second stage).
- Severity: sec-high (content→parent arbitrary directory deletion / arbitrary command-line-argument injection). Bounded by: Windows-only, requires a compromised content process, and one user click on the poisoned (but fully spoofed) jumplist item.
Defect(s)
Defect A — RecvVisitURI accepts a content-supplied visit URI without validation
dom/ipc/BrowserParent.cpp:4119
mozilla::ipc::IPCResult BrowserParent::RecvVisitURI(
nsIURI* aURI, nsIURI* aLastVisitedURI, const uint32_t& aFlags,
const uint64_t& aBrowserId) {
if (!aURI) {
return IPC_FAIL_NO_REASON(this);
}
...
nsCOMPtr<IHistory> history = components::History::Service();
if (history) {
(void)history->VisitURI(widget, aURI, aLastVisitedURI, aFlags, aBrowserId);
}
The content-serialized nsIURI is only null-checked — no scheme validation, no re-canonicalization — before
it is handed to the history service. A compromised content process fully controls the stored spec, including
raw spaces and an injected command-line flag.
Defect B — CanStore is allow-by-default and the stored spec preserves raw spaces
docshell/base/BaseHistory.cpp:31
bool BaseHistory::CanStore(nsIURI* aURI) {
nsAutoCString scheme;
...
if (!scheme.EqualsLiteral("http") && !scheme.EqualsLiteral("https")) {
for (const nsLiteralCString& disallowed : kDisallowedSchemes) {
if (scheme.Equals(disallowed)) {
return false;
}
}
}
nsAutoCString spec;
aURI->GetSpec(spec);
return spec.Length() <= StaticPrefs::browser_history_maxUrlLength();
}
Any scheme that is not http/https and not in the fixed kDisallowedSchemes denylist is stored — i.e. any
unknown scheme (such as a single-letter drive C:) is accepted. The spec is an nsSimpleURI, and
nsSimpleURI::SetSpecInternal escapes with esc_OnlyNonASCII + MaskCRLFTab() (nsSimpleURI.cpp:219;
nsEscape.cpp), which keeps all ASCII 0x20–0x7E — space 0x20 and quote 0x22 are not escaped — and
strips only CR/LF/Tab. So the attacker's raw spaces survive the IPC deserialize and the moz_places storage.
Defect C — the jumplist "Frequent" list uses the raw moz_places.url as shortcut arguments
browser/modules/WindowsJumpLists.sys.mjs:266
customDescriptions.push({
title: row.getResultByName("title"),
description: row.getResultByName("title"),
path: selfPath, // = firefox.exe (XREExeF)
arguments: row.getResultByName("url"), // = the RAW stored spec
fallbackIconIndex: 1,
iconPath,
});
The item's arguments are the raw stored p.url, not a re-parsed/re-canonicalized uri.spec, and the
selecting query (… WHERE hidden=0 AND EXISTS(… visit_type NOT IN (0, EMBED, FRAMED_LINK) …) ORDER BY p.visit_count DESC LIMIT :limit, :233) applies no scheme filter. Default-on
(browser.taskbar.lists.frequent.enabled=true, firefox.js:1677); rebuilt on a 120 s timer and on Places
history changes, no user gesture required.
Defect D — SetArguments is called on the raw string, unescaped
widget/windows/JumpListBuilder.cpp:853
hr = psl->SetPath(aDesc.mPath.get());
...
if (aDesc.mArguments.WasPassed() && !aDesc.mArguments.Value().IsEmpty()) {
hr = psl->SetArguments(aDesc.mArguments.Value().get()); // :876, raw, no escaping
}
The raw arguments string is passed straight to IShellLinkW::SetArguments with no escaping/quoting (the
sibling shell-link code carries an explicit // TODO … bug 1604287). On click, Windows command-line-parses
the stored string, splitting on the raw spaces into separate argv — so the injected flag becomes a real
Firefox argument.
End-to-end chain (6 steps)
- Compromised content sends
SendVisitURI(SimpleURIParams{ spec: "C:\Users\<user> Documents 2 --backgroundtask removeDirectory" }, …, IHistory::TOP_LEVEL, …)(History.cpp:1945). The leadingC:is both the unknown URL scheme "c" and, on launch, a valid absoluteparentDirPath(the stored spec is lowercased toc:\…, still a valid drive path). - Parent
RecvVisitURIforwards it unvalidated to the history service (dom/ipc/BrowserParent.cpp:4131). CanStoreaccepts scheme "c" andmoz_places.urlstores the spec verbatim, raw spaces intact (docshell/base/BaseHistory.cpp:31). Content also sendsSetURITitle(sameURI, "Google")—RecvSetURITitle(dom/ipc/ContentParent.cpp:4771) is likewise unvalidated — so the item's label reads "Google" (the query isIFNULL(p.title, p.url), so without this the label would be the raw payload string).- Repeated visits push
visit_countinto the top 7; within ≤120 s the jumplist auto-rebuilds and selects the poisoned row (browser/modules/WindowsJumpLists.sys.mjs:233), pushing{ path: firefox.exe, arguments: <raw url> }(:266). JumpListBuilderwrites a shortcutSetPath(firefox.exe)+SetArguments(<raw url>)unescaped into the realcustomDestinations-ms(widget/windows/JumpListBuilder.cpp:853,876).- The user opens the taskbar "Frequent" list and clicks the spoofed "Google" item → Windows launches
firefox.exe C:\Users\<user> Documents 2 --backgroundtask removeDirectory; argv splits to[C:\Users\<user>, Documents, 2, --backgroundtask, removeDirectory];BackgroundTask_removeDirectory.sys.mjsdoesinitWithPath(getArgument(0)).append(getArgument(1)).remove(true)→ deletesC:\Users\<user>\Documents.
PoC reproduction
See poc/README.md; full logs (incl. the argument-alignment and literal-taskbar-click checks) in
poc/RESULTS.txt.
- Content-side forge (Linux, parent unmodified):
poc/forge.patchadds a diagnostic printf inHistory::VisitURIand an env-gated stand-in inWindowGlobalChild::Createthat, for a marked page, callsbrowserChild->SendVisitURI(forgedURI, …, IHistory::TOP_LEVEL, …)— modeling a compromised content process (poc/pocvisit_server.pyserves the marker page). - Windows end-to-end (published Nightly):
poc/e2e_run.ps1seeds the poisonedplaces.sqlite(poc/seed_places.py), drives Firefox's ownWinTaskbarJumpList.buildList()(poc/mar_forcebuild.py) to serialize the shortcut into the real jumplist file, then extracts that shell-link andShellExecutes it (poc/e2e_invoke.py, identical to the taskbar click) → deletion.
Empirical proof
Full logs: poc/RESULTS.txt.
- Input side (Linux, parent unmodified): content sends the forged URI; parent receives it with raw spaces
intact and
moz_places.urlreads back the spec with its raw spaces (hasSpace=YES).newURI("C:\\Users\\victim Documents 2 --backgroundtask removeDirectory").speckeeps the raw spaces (the scheme is lowercased toc:, still a valid drive path). - Argument alignment (Linux, real firefox command-line parser): for a
<parent> <child> 2 --backgroundtask removeDirectoryargv,removeDirectoryreads the positionals in order and deletes<parent>/<child>; a colon in argv[1] does not divert Firefox to URL/remote mode. This is why the drive-letter payload — where the scheme prefix is the parent path — aligns, while a scheme-prefix-first payload would misalign (its prefix would becomegetArgument(0)). TheC:\-path resolution itself is covered by the Windows run below. - Continuous end-to-end (Windows, published Nightly), no human interaction: a
places.sqliteseeded with the poisoned row (content-forge stand-in) → Firefox's ownWinTaskbarJumpList.buildList()(the real "Frequent" query +arguments = row.url+nsIJumpListBuilder.populateJumpList, driven via Marionette chrome-context —builtList: true) wrote the real%APPDATA%\…\CustomDestinations\<id>.customDestinations-ms(shell-link Target=…\firefox.exe, Title="Google", Arguments=C:\Users\<user>\pocjl deleteme 2 --backgroundtask removeDirectory, unescaped) → the actual serialized shell-link, extracted from that file andShellExecuted (identical to a taskbar click) →C:\Users\<user>\pocjl\deletemeDELETED (victim before: True → after: False). Driver:poc/e2e_run.ps1. - Literal taskbar mouse-click (Windows, published Nightly), hands-free (logged in
poc/RESULTS.txt): with the jumplist poisoned as above, a UI-Automation script right-clicked theFirefox Nightlytaskbar button (jump list opened) and clicked the spoofed "Google" item in the "Frequent" list — the target directory was DELETED, confirming the real taskbar click (not justShellExecute) triggers the deletion. - The single remaining stand-in is content→
moz_places(a DB seed on Windows), which is separately confirmed on Linux above with an unmodified parent. Every other stage — Firefox building the jumplist, the real serialized shell-link, and the physical taskbar click — is exercised for real on a published build.
Recommend fix
Fix A — escape the jumplist arguments (root of defect D / bug 1604287)
Do not pass a raw string to SetArguments; quote it per CommandLineToArgvW rules before building the
shell link in JumpListBuilder.cpp.
Fix B — the jumplist should not use the raw history spec
In WindowsJumpLists.sys.mjs, filter the "Frequent" items to http/https and use the re-parsed
Services.io.newURI(row.url).spec, not the raw row.getResultByName("url") (:266).
Fix C — re-canonicalize the content-supplied URI in the parent
BrowserParent::RecvVisitURI should re-parse/scheme-validate aURI before storing, so content cannot pin an
arbitrary raw spec into history.
Fix D — tighten history storage
Consider converting BaseHistory::CanStore to a scheme allowlist rather than allow-by-default.
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 parent trusted a content-supplied URI without validation, history storage accepted unknown schemes and kept raw spaces, and the jumplist passed the stored URL to the shell link as unescaped arguments.
Impact
A compromised content process could escape the sandbox to delete an arbitrary directory at full user privilege, but only on Windows and only after one click on the spoofed jumplist item.
What the attacker needed
Compromised content process; Windows; user clicks spoofed jumplist item; default jumplist settings
The fix
The jumplist arguments should be quoted per Windows command-line rules, the jumplist should use a re-parsed http/https URI rather than the raw stored spec, and the parent should re-canonicalise and scheme-validate content-supplied URIs before storing them.
How it was found
- A compromised content process sends a visit URI whose spec contains raw spaces and an injected flag, plus a title of 'Google'.
- The parent forwards the URI unvalidated to the history service and stores it verbatim in moz_places.
- Repeated visits push the entry into the top of the 'Frequent' list, and the jumplist rebuilds within 120 seconds.
- The jumplist writes a firefox.exe shortcut with the raw URL as unescaped arguments into the real jumplist file.
- The user opens the taskbar 'Frequent' list and clicks the spoofed 'Google' item.
- Windows splits the arguments and Firefox runs the background task that deletes the target 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.
Firefox splits its work into a sandboxed part that renders web pages and a more powerful parent process. The report shows that the sandboxed part could hand the parent a fake 'page visited' record containing spaces and an extra command-line option, and that the Windows taskbar shortcut list later reused that text as launch arguments. When the user clicked the shortcut, Windows treated the extra text as a real Firefox option, which deleted a folder.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.