Uninitialized stack info leak in `FilterNodeTableTransferSoftware` via PCanvas IPC
A filter node in Firefox's graphics code declares a 1024-byte lookup table on the stack without initialising it, and an early return leaves it unfilled when no table values are supplied. A compromised content process can enable the filter channels and read back the uninitialised stack bytes of the GPU process through the canvas IPC interface.
- Fixed in 5 days
- Paid in 40 days
- Disclosed after 5 days
Created attachment 9547002 diff.patch
Summary
FilterNodeComponentTransferSoftware::Render() (gfx/2d/FilterNodeSoftware.cpp, line 1822-1877) declares an uninitialized uint8_t lookupTables[4][256] (1024 bytes) on the stack. When a TABLE_TRANSFER filter channel is enabled (mDisable*=false) but no table values are provided, FillLookupTableImpl returns without filling the table. The uninitialized stack data is then used as a byte-to-byte mapping over attacker-controlled input pixels, allowing a compromised content process to read 1024 bytes of GPU process stack memory via PCanvas IPC.
uint8_t lookupTables[4][256]; // line 1828: uninitialized
GenerateLookupTable(B8G8R8A8_COMPONENT_BYTEOFFSET_R, // line 1829: calls FillLookupTable
lookupTables, mDisableR); // when mDisableR == false
// FillLookupTableImpl (line 1951-1956):
uint32_t tvLength = aTableValues.size();
if (tvLength < 2) {
return; // early return, table NOT filled
}
// TransferComponents<4> (line 1797-1804):
for (uint32_t i = 0; i < BytesPerPixel; i++) {
targetData[targetIndex + i] =
aLookupTables[i][sourceData[sourceIndex + i]]; // reads uninitialized table
}
Root Cause
The vulnerability involves three components:
-
Uninitialized declaration (line
1828):uint8_t lookupTables[4][256]is declared on the stack without initialization. -
Early return without fill (line
1951-1956):FilterNodeTableTransferSoftware::FillLookupTableImplchecksif (tvLength < 2) { return; }. When no table values have been set (emptystd::vector<Float>),tvLength=0 < 2, and the function returns immediately without writing anything toaTable[256]. -
Channel enable path (line
1766-1774):GenerateLookupTablefills an identity table only whenaDisabled=true. WhenaDisabled=false, it callsFillLookupTable, which dispatches toFillLookupTableImpl. Since the table values vector is empty by default, the early return is taken, leaving the 256-byte table uninitialized.
The constructor (line 1742-1743) sets all mDisable* flags to true, but a compromised content process can set them to false via SetAttribute(uint32_t, bool) (line 1745-1764) using the PCanvas FILTERNODESETATTRIBUTE event with ARGTYPE_BOOL (valid enum value 1 within the accepted range [0, 13]).
Triggerability
A compromised content process can reliably trigger this by sending PCanvas IPC events that:
- Create a
TABLE_TRANSFERfilter node (FilterType::TABLE_TRANSFER = 6). - Set
ATT_TRANSFER_DISABLE_R/G/B/A(indices0-3) tofalseviaFILTERNODESETATTRIBUTEwithARGTYPE_BOOL. - Do NOT set
ATT_TABLE_TRANSFER_TABLE_R/G/B/A(indices4-7), leaving the table values vectors empty. - Draw a surface through the filter.
The input surface pixel values serve as indices into the uninitialized lookup tables. By crafting a 256x1 input surface where pixel x has channel value x, the attacker queries every byte of all four 256-byte tables, extracting the full 1024 bytes of uninitialized stack data.
Note: Firefox debug builds enable -ftrivial-auto-var-init=pattern (build/moz.configure/toolchain.configure, line 2930-2944), which fills uninitialized stack variables with 0xAA. This masks the leak in debug builds but confirms the table IS uninitialized. Release builds do not enable this flag and expose real stack data.
Tested on Firefox commit:
f8345be3cabc1944760d536c4a43192a02000406
Sun Feb 15 23:53:08 2026 +0000
Attack Scenario
A compromised content process:
- Creates a
PCanvasactor viaCanvasManagerChild. - Serializes initial recorded events into shared memory:
CANVAS_DRAW_TARGET_CREATION(initializes translator draw target)SETCURRENTDRAWTARGET(sets active draw target)PAUSE_TRANSLATION(puts translator intoPausedstate)
- Calls
SendInitTranslatorto start GPU-side translation. - After the translator reaches
Pausedstate, serializes attack events:CREATESOURCESURAFCEFROMPREVIOUSLYSNAPSHOTTEDSURFACE(creates input surface)CREATEFILTERNODEwithFilterType::TABLE_TRANSFER(creates the filter node)FILTERNODESETATTRIBUTEx4 withARGTYPE_BOOL=1, settingATT_TRANSFER_DISABLE_R/G/B/A(indices0-3) tofalseFILTERNODESETINPUTwithIN_TRANSFER_IN=0(connects input surface to filter)DRAWFILTER(triggersRender()which uses the uninitialized lookup tables)SNAPSHOT(captures the output surface containing leaked stack data)CACHE_DATA_SURFACE(caches the snapshot)GET_DATA_FOR_SURFACE(reads the data back into shared memory)
- Calls
SendResumeTranslationto process the attack events on the GPU process. - GPU process executes the filter in
FilterNodeComponentTransferSoftware::Render():lookupTables[4][256]is allocated on the stack (uninitialized).GenerateLookupTableis called withmDisableR/G/B/A = false.FillLookupTableImplreturns immediately becauseaTableValues.size() == 0 < 2.TransferComponents<4>maps each input byte through the uninitialized table:targetData[i] = lookupTables[ch][sourceData[i]].- The output surface now contains GPU process stack data indexed by attacker-controlled input pixel values.
- The output surface data is written to shared memory via
GET_DATA_FOR_SURFACE. - Content process reads back the shared memory, recovering 1024 bytes of GPU process stack.
- The leak can be repeated to obtain fresh stack data on each invocation, potentially revealing return addresses (defeating ASLR), function pointers, or other sensitive data from the GPU process.
Reproduction
Build Firefox with tests enabled (release mode recommended to see real stack data):
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-release
ac_add_options --disable-install-strip
ac_add_options --enable-debug-symbols
ac_add_options --enable-tests
ac_add_options --with-ccache=sccache
Apply the attached patch (diff.patch) and rebuild, then run:
./mach mochitest dom/bindings/test/test_tableTransferLeak.html
Expected result:
- The test output shows
leaked:N/1024whereN > 0, indicating bytes that differ from identity mapping. - In debug builds, leaked bytes are all
0xAAdue to-ftrivial-auto-var-init=pattern. - In release builds, leaked bytes contain actual GPU process stack data.
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 a missing initialisation of the stack lookup table combined with an early return in FillLookupTableImpl when fewer than two table values are supplied, so the table is used while still holding stale stack contents.
Impact
A compromised content process could leak GPU process stack memory, potentially revealing return addresses and defeating ASLR; debug builds mask the leak with a pattern fill, so only release builds expose real data.
What the attacker needed
Compromised content process; release build to see real stack data
How it was found
- Create a TABLE_TRANSFER filter node through the canvas IPC interface.
- Set the four channel-disable attributes to false without providing any table values.
- Connect an input surface whose pixel values act as indices into the table.
- Draw through the filter and snapshot the output surface.
- Read the surface data back into shared memory and recover the leaked stack bytes.
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.
Some programs keep short-lived data in a memory area called the stack, and that area can still hold leftovers from earlier work. Here a graphics filter forgot to clear a small table before using it as a lookup, so whatever was left on the stack got copied into the output image. A malicious page that has already broken out of its sandbox could then read those leftovers, which may include memory addresses useful for further attacks.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.