Skip to content
Info disclosure Advisory Advanced CVE-2026-112992

Observable discrepancy in Canvas (CVE-2026-112992)

The createPattern canvas API does not apply the EXIF orientation privacy clamp that drawImage applies to cross-origin images, so the same image can be rendered in both oriented and unoriented forms. An attacker could use a rendering timing side-channel to infer the private EXIF orientation of a cross-origin image.

Google Chrome

Originally disclosed on Chrome VRP

  • Fix shipped in 5 months

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

Overview: The createPattern API in CanvasRenderingContext2D fails to apply the EXIF orientation privacy clamp to cross-origin images, unlike drawImage. This discrepancy allows a malicious website to render both oriented and unoriented versions of an image, potentially leaking private EXIF orientation metadata via rendering side-channels.

Affected files:

  • third_party/blink/renderer/modules/canvas/canvas2d/canvas_2d_recorder_context.cc
  • third_party/blink/renderer/platform/graphics/image_pattern.cc

Estimated timestamp from git blame: 2020-10-21

Chromium implements an EXIF-orientation privacy clamp that forces cross-origin images (which taint the canvas) to always render with their EXIF orientation applied. This ensures a consistent state and prevents attackers from probing private EXIF metadata through layout or rendering differences.

However, there is a discrepancy in how this clamp is enforced between drawImage and createPattern.

Technical Details

In third_party/blink/renderer/modules/canvas/canvas2d/canvas_2d_recorder_context.cc, drawImage evaluates RespectImageOrientationInternal(image_source). It passes this flag down via ImageDrawOptions, ensuring the underlying rendering pipeline (e.g., StaticBitmapImage::DrawHelper) applies the correct geometric transform matrix before drawing the image.

Conversely, Canvas2DRecorderContext::createPattern calls RespectImageOrientationInternal(), but only uses the return value to format a DOMException error string if the image dimensions are zero. The CanvasPattern object is constructed using the raw, unoriented PaintImage obtained via image->PaintImageForCurrentFrame() in ImagePattern::ImagePattern.

When this pattern is subsequently used in a fill operation, ImagePattern::CreateShader generates an SkShader using the raw image data and only applies the user-defined patternTransform. No EXIF orientation matrix is applied, allowing the cross-origin image to be rendered in its unoriented state, bypassing the privacy clamp.

Potential Exploitation Steps

Note: The following steps are potential mechanisms identified via code analysis; our tooling agent does not yet have the capability to run and verify a live Proof of Concept.

An attacker could potentially exploit this discrepancy to leak the EXIF orientation of cross-origin images:

  1. Embed a cross-origin image on a malicious webpage.
  2. Create a 2D canvas and use ctx.drawImage() to draw the image. This renders the oriented version and taints the canvas.
  3. Change ctx.globalCompositeOperation to difference.
  4. Use ctx.createPattern() with the same image and ctx.fillRect() to draw the unoriented pattern over the first image.
  5. If the image has a non-default EXIF orientation, the mismatch leaves colored pixels on the canvas. If the orientation is default, the images align perfectly, leaving the canvas fully transparent/black.
  6. Apply a computationally expensive SVG filter (e.g., feColorMatrix or feComponentTransfer) to the tainted canvas.
  7. Measure the rasterization timing using requestAnimationFrame. The performance difference between processing empty/black pixels versus colored pixels serves as an oracle, leaking the private EXIF orientation state.

Suggested Fix

Update Canvas2DRecorderContext::createPattern to properly utilize the result of RespectImageOrientationInternal(image_source). If the orientation must be respected, the CanvasPattern (or its underlying ImagePattern) should be provided with the appropriate orientation transform matrix. ImagePattern::CreateShader should then pre-multiply this orientation transform into the local_matrix before generating the SkShader.

Evaluated with Chrome root at commit: b7d0c4d810da1b31400f198c70d9720fc8f0e5a0


Results so far have been promising, but there can be wrong deductions. Feel free to adjust as follows:

  • If you are familiar with the severity guidelines, you may adjust the severity.
  • If this is a false positive, and there's no work to be done, please close as WAI.
  • If there is work to do here but not a vulnerability, please change the issue type to Task/Bug/FR.

Data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.

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

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely createPattern ignores the result of RespectImageOrientationInternal and builds the pattern from the raw, unoriented image, so no orientation transform is applied when the shader is created.

Impact

An attacker could potentially learn the private EXIF orientation of cross-origin images, though the report notes the mechanism was found by code analysis and no live proof of concept was run.

What the attacker needed

Victim visits attacker page; cross-origin image with EXIF data; timing measurement in browser

The fix

createPattern should use the result of RespectImageOrientationInternal and pass an orientation transform into the pattern so the shader applies it.

How it was found

  1. Embed a cross-origin image on a malicious webpage.
  2. Draw the image with drawImage on a 2D canvas, which renders the oriented version and taints the canvas.
  3. Set the composite operation to difference.
  4. Create a pattern from the same image and fill a rectangle with it, drawing the unoriented version.
  5. Apply an expensive SVG filter to the tainted canvas.
  6. Measure rasterisation timing with requestAnimationFrame to tell whether pixels differ.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

Photos taken on phones often store a hidden note saying which way up the picture should be shown, called EXIF orientation. Browsers normally hide this note from other websites by always drawing cross-origin images the same way. Here one drawing function skipped that rule, so a page could draw the same image two different ways and work out the hidden note by timing how long the browser takes to draw it.

What is Info disclosure?

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.