Skip to content
Memory corruption Advisory Advanced CVE-2026-9972

Uninitialized Use in Gamepad (CVE-2026-9972)

An uninitialized memory bug in the macOS gamepad code could let a compromised renderer write controlled data to arbitrary addresses in the browser process. The flaw arises because a force-feedback struct is not initialised when the gamepad lacks custom force support, and a wrong check allows the uninitialised pointer to be used.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 27 days

Flapjack, an experimental security project, has identified the following potential security issue. If you're a feature owner CC-ed on this bug, please do your best to review these reports without the Chrome Security team. Please see https://chromium.googlesource.com/chromium/src/+/main/docs/security/ai-generated-security-bugs-faq.md for more information.

Overview: A potential arbitrary write vulnerability exists in the macOS gamepad implementation (GamepadDeviceMac). If a connected gamepad lacks custom force capabilities, a POD struct remains uninitialized on the heap. A compromised renderer can leverage this uninitialized memory via the Gamepad API to write controlled data to arbitrary addresses in the Browser process.

Affected files:

  • device/gamepad/gamepad_device_mac.mm
  • device/gamepad/gamepad_device_mac.h

Estimated timestamp from git blame: 2018-01-12

Summary

A logic error and uninitialized memory vulnerability in GamepadDeviceMac allows a compromised renderer process to potentially achieve an arbitrary memory write in the Browser process on macOS. This issue occurs when handling generic gamepads that support Force Feedback but lack the FFCAP_ET_CUSTOMFORCE capability, leading to the use of an uninitialized system struct containing raw pointers.

Technical Details

The GamepadDeviceMac class (device/gamepad/gamepad_device_mac.mm) contains a member ff_effect_ of type FFEFFECT, which is a POD C-struct defined in the macOS ForceFeedback framework. Because this member is omitted from the constructor's initializer list, C++ default-initialization rules leave its memory contents indeterminate when the object is allocated on the heap.

During object construction, the code attempts to initialize this struct by calling CreateForceFeedbackEffect. However, if the device lacks the FFCAP_ET_CUSTOMFORCE capability, the function returns early without touching the struct:

C++
// In GamepadDeviceMac::CreateForceFeedbackEffect
if ((caps.supportedEffects & FFCAP_ET_CUSTOMFORCE) == 0)
  return nullptr;
// ... struct initialization happens after this point ...

When a website requests a vibration effect, GamepadDeviceMac::SetVibration is called. This function contains a critical logic error: it checks whether the device reference (ff_device_ref_) is valid, rather than checking if the effect reference (ff_effect_ref_) was successfully created.

C++
// In GamepadDeviceMac::SetVibration
if (ff_device_ref_) { // BUG: Should check ff_effect_ref_
  FFCUSTOMFORCE* ff_custom_force =
      static_cast<FFCUSTOMFORCE*>(ff_effect_.lpvTypeSpecificParams);
  DCHECK(ff_custom_force); // Compiled out in release builds
  DCHECK(ff_custom_force->rglForceData);

  ff_custom_force->rglForceData[0] =
      static_cast<LONG>(params->strong_magnitude * kRumbleMagnitudeMax);
  ff_custom_force->rglForceData[1] =
      static_cast<LONG>(params->weak_magnitude * kRumbleMagnitudeMax);

Because ff_device_ref_ is non-null but ff_effect_ is uninitialized, the code treats indeterminate heap data as the lpvTypeSpecificParams pointer. It then performs a double-indirection read to resolve rglForceData, and writes the attacker-provided strong_magnitude and weak_magnitude values (scaled by kRumbleMagnitudeMax) to that address.

MiraclePtr (BackupRefPtr) does not mitigate this because FFEFFECT is a macOS system struct using raw C pointers.

Suggested Exploitation Steps

Note: These are potential steps based on code analysis; our tooling cannot run live code to provide a working PoC.

  1. Heap Spray: A compromised renderer process uses Mojo IPC to spray the Browser process's heap, populating unallocated memory chunks with a crafted payload. This payload sets up a fake pointer chain for lpvTypeSpecificParams and rglForceData targeting a critical memory address (e.g., a vtable or callback pointer).
  2. Trigger Allocation: A generic gamepad (supporting basic force feedback but not custom forces) is connected. The Browser allocates a GamepadDeviceMac over the sprayed heap memory.
  3. Uninitialized Memory: The ff_effect_ struct inherits the attacker's fake pointer chain.
  4. Arbitrary Write: The compromised renderer sends a PlayVibrationEffectOnce Mojo message, bypassing standard JS clamping to provide specific double magnitude values.
  5. Execution: The Browser process processes the vibration, dereferences the attacker-controlled pointer chain, and writes the calculated LONG (64-bit on macOS) values to the attacker's chosen address, potentially allowing a full sandbox escape.

Suggested Fix

  1. Initialize POD members: In device/gamepad/gamepad_device_mac.h, explicitly value-initialize the POD structs by appending {}:
    C++
    FFEFFECT ff_effect_{};
    FFCUSTOMFORCE ff_custom_force_{};
    
  2. Fix the logic check: In device/gamepad/gamepad_device_mac.mm, update SetVibration to check the effect reference rather than the device reference:
    C++
    // Change line 474 from:
    // if (ff_device_ref_) {
    // To:
    if (ff_effect_ref_) {
    

Evaluated with Chrome root at commit: cc901875d53bf4e4fe0e01f02843871da4106e70


Results 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.

The original report as published on the Chromium issue tracker. Images and videos are our own copies; raw HTML is shown as text. View it on Chromium issue tracker.

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 force-feedback struct member is not initialised in the constructor, and SetVibration checks the device reference instead of the effect reference, so an uninitialised pointer is dereferenced.

Impact

A compromised renderer could potentially achieve an arbitrary write in the browser process, which may lead to a full sandbox escape.

What the attacker needed

Compromised renderer process; macOS; gamepad without custom force support

The fix

The struct members should be value-initialised and the logic check should test the effect reference instead of the device reference.

How it was found

  1. A compromised renderer uses Mojo IPC to spray the browser process heap with a crafted payload that sets up a fake pointer chain.
  2. A generic gamepad that supports basic force feedback but not custom forces is connected, causing the browser to allocate a GamepadDeviceMac over the sprayed memory.
  3. The uninitialised ff_effect_ struct inherits the attacker's fake pointer chain.
  4. The compromised renderer sends a PlayVibrationEffectOnce Mojo message with specific magnitude values.
  5. The browser processes the vibration, dereferences the attacker-controlled pointer chain, and writes the calculated values to the chosen address.

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.

When a program creates an object, some of its memory may be left with whatever old data was there before. If the program later uses that memory as if it were a valid pointer (an address to another place in memory), an attacker who can influence that old data might trick the program into writing to a location of their choosing. Here, a gamepad feature leaves such a pointer uninitialised, and a wrong check lets it be used.

What is Memory corruption?

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Memory corruption

The lesson behind this report.

Native code reads or writes memory it should not: overflows, use-after-free, type confusion. The core of browser, kernel and parser bugs.