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

Out of bounds memory access in Skia (CVE-2026-10941)

A chain of validation failures in the Rust-based moxcms ICC profile parser and the Skia C++ FFI layer allows malformed profiles to specify invalid colour channel counts, leading to a heap out-of-bounds read and a stack buffer overflow in skcms_Transform. An attacker could potentially achieve remote code execution in the renderer by controlling heap memory.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 46 days

Project Fortify, 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 chain of validation failures in the Rust-based moxcms ICC profile parser and the Skia C++ FFI layer allows malformed profiles to specify invalid color channel counts. This results in a heap out-of-bounds read and a subsequent stack buffer overflow within skcms_Transform, potentially leading to Remote Code Execution in the renderer. The vulnerability is active when the Rust-based parser is used (which is the default migration path).

Affected files:

  • third_party/rust/chromium_crates_io/vendor/moxcms-v0_8/src/reader.rs
  • third_party/skia/rust/icc/FFI.cpp
  • third_party/skia/src/codec/SkCodecColorProfileRust.cpp
  • third_party/skia/modules/skcms/skcms.cc

Estimated timestamp from git blame: 2026-02-24

Overview

A potential vulnerability exists in the handling of ICC profiles when parsed via the Rust-based moxcms library (the default path when kForceSkcmsICCParsing is disabled). A sequence of bugs across the Rust and C++ boundary allows a malicious ICC profile to define an invalid number of color channels (e.g., 200). When skcms processes this profile, it attempts to load curves for all 200 channels, leading to a massive heap out-of-bounds read and a stack buffer overflow. By carefully controlling the out-of-bounds heap memory, an attacker could selectively overwrite stack pointers without hitting the stack canary, constructing a highly reliable arbitrary heap write primitive to gain RCE.

Technical Details

The vulnerability is the result of three sequential failures:

1. Permissive Validation in moxcms: In third_party/rust/chromium_crates_io/vendor/moxcms-v0_8/src/reader.rs, when parsing mft2 tags, the channel counts are extracted and validated:

Rust
let in_chan = tag[8];
let out_chan = tag[9];
let is_3_to_4 = in_chan == 3 || out_chan == 4;
let is_4_to_3 = in_chan == 4 || out_chan == 3;
if !is_3_to_4 && !is_4_to_3 {
    return Err(CmsError::InvalidProfile);
}

If an attacker sets out_chan = 3 and in_chan = 200, is_4_to_3 evaluates to true, and the validation completely bypasses the invalid 200 value.

2. Early Assignment in FFI Layer: In third_party/skia/rust/icc/FFI.cpp, the ToSkcmsA2B function constructs the C++ skcms_A2B struct:

C++
out_skcms->input_channels = rust_a2b.input_channels;
if (rust_a2b.input_channels > 0) {
    if (rust_a2b.input_channels < 1 || rust_a2b.input_channels > 4) {
        return false;
    }
    // ...
}

Although the function detects the invalid input_channels (200 > 4) and returns false, it writes the invalid value to out_skcms before the check, permanently polluting the structure.

3. Ignored Error Return: In third_party/skia/src/codec/SkCodecColorProfileRust.cpp, the boolean return value of ToSkcmsIccProfile is ignored:

C++
skcms_ICCProfile profile;
rust_icc::ToSkcmsIccProfile(*retained, &profile); // Returns false, but is ignored
auto result = std::unique_ptr<ColorProfile>(
        new ColorProfile(profile, std::move(data)));

Memory Corruption in skcms: When drawing the image, skcms_Transform (third_party/skia/modules/skcms/skcms.cc) processes the profile. It calls add_curve_ops(srcProfile->A2B.input_curves, 200). Inside add_curve_ops:

C++
auto add_curve_ops = [&](const skcms_Curve* curves, int numChannels) -> bool {
    OpAndArg oa[4];
    int numOps = select_curve_ops(curves, numChannels, oa);
// ...

select_curve_ops loops 200 times (for (int index = numChannels; index-- > 0; )). It accesses curves[index]. Because curves is only a 4-element array in the heap-allocated ColorProfile, this is a heap out-of-bounds read.

select_curve_ops writes to the 4-element stack array oa: ops[cursor] = select_curve_op(...). The cursor only increments if the returned arg is non-null. By using a heap spray to control the out-of-bounds memory, an attacker can ensure most reads result in nullptr arguments, precisely incrementing cursor to overflow the oa array just enough to overwrite local stack pointers (like contexts) without hitting the stack canary.

Later, add_op_ctx uses the corrupted contexts pointer (*contexts++ = c;), granting an arbitrary heap write primitive.

Potential Attacker Steps (Suggested)

Note: Our tooling agent cannot run code, so these are theoretical steps based on source code analysis.

  1. The attacker creates an HTML page containing JavaScript to perform a precise heap spray in the renderer process.
  2. The heap spray lays out fake skcms_Curve data and fake vtables directly adjacent to where ColorProfile objects are allocated.
  3. The attacker embeds a PNG image with a crafted iCCP chunk containing an mft2 tag with in_chan = 200 and out_chan = 3.
  4. When Chrome parses the image and invokes skcms_Transform, the out-of-bounds heap read consumes the sprayed data.
  5. The precisely controlled stack overflow overwrites the contexts pointer to point at the vtable of a neighboring C++ object.
  6. The subsequent arbitrary heap write overwrites the vtable pointer with the address of the fake vtable.
  7. When a virtual method on the neighboring object is called, execution is hijacked to a ROP chain.

Suggested Fix

  1. moxcms: Fix the validation in reader.rs to strictly check both in_chan and out_chan limits independently, avoiding the is_3_to_4 logic flaw.
  2. FFI Layer: In FFI.cpp (ToSkcmsA2B), perform the range validation (< 1 || > 4) before assigning input_channels to out_skcms.
  3. Skia: In SkCodecColorProfileRust.cpp, explicitly check the return value of rust_icc::ToSkcmsIccProfile. If it returns false, abort the parsing and return nullptr.

Evaluated with Chrome root at commit: 2b349e31cb87959d6a548625986c65e0a2d2e380


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 combination of permissive validation in moxcms, early assignment of an invalid channel count in the FFI layer before checking it, and ignoring the error return in Skia, which together allow an invalid channel count to reach skcms_Transform.

Impact

An attacker could potentially achieve remote code execution in the renderer by controlling heap memory to overwrite stack pointers and gain an arbitrary heap write primitive.

What the attacker needed

Victim views a malicious image; attacker can perform heap spray; Chrome uses Rust-based ICC parser

The fix

The validation in moxcms should strictly check both in_chan and out_chan limits independently, the FFI layer should perform range validation before assigning input_channels, and Skia should explicitly check the return value of ToSkcmsIccProfile and abort parsing on failure.

How it was found

  1. The attacker creates an HTML page containing JavaScript to perform a precise heap spray in the renderer process.
  2. The heap spray lays out fake skcms_Curve data and fake vtables directly adjacent to where ColorProfile objects are allocated.
  3. The attacker embeds a PNG image with a crafted iCCP chunk containing an mft2 tag with in_chan = 200 and out_chan = 3.
  4. When Chrome parses the image and invokes skcms_Transform, the out-of-bounds heap read consumes the sprayed data.
  5. The precisely controlled stack overflow overwrites the contexts pointer to point at the vtable of a neighbouring C++ object.
  6. The subsequent arbitrary heap write overwrites the vtable pointer with the address of the fake vtable, and when a virtual method is called, execution is hijacked to a ROP chain.

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.

An ICC profile is a small file that tells software how to interpret colours in an image. The code that reads these profiles had several mistakes that let a specially crafted profile claim it had far more colour channels than allowed, causing the program to read and write memory outside its intended bounds. This could let an attacker run their own code on the victim's computer when the victim views a malicious image.

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.