Observable discrepancy in SVG (CVE-2026-79016)
Blink's SVG filter builder creates the builtin FillPaint, StrokePaint and SourceAlpha filter effects without carrying over the origin-taint flag, and the feDisplacementMap filter only checks its second input for taint. An attacker could therefore feed cross-origin pixels into a displacement map and infer their values from rendering time differences.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 5 months
Project Fortify, an experimental security project, has identified the following potential security issue.
Overview: Blink's SVG filter implementation potentially fails to propagate origin-taint status to builtin filter inputs like FillPaint, StrokePaint, and SourceAlpha. This oversight allows an attacker to bypass security restrictions on the <feDisplacementMap> filter intended to prevent timing side-channel attacks. By using a tainted canvas pattern as FillPaint for a displacement map, an attacker could extract cross-origin pixel data by measuring rendering time variations.
Affected files:
third_party/blink/renderer/core/svg/graphics/filters/svg_filter_builder.ccthird_party/blink/renderer/platform/graphics/filters/fe_displacement_map.ccthird_party/blink/renderer/modules/canvas/canvas2d/canvas_rendering_context_2d_state.ccthird_party/blink/renderer/core/paint/filter_effect_builder.ccthird_party/blink/renderer/platform/graphics/filters/paint_filter_effect.ccthird_party/blink/renderer/platform/graphics/filters/source_alpha.cc
Estimated timestamp from git blame: 2020-02-18
Summary
A potential vulnerability in Blink's SVG filter building logic allows an attacker to bypass the origin-taint check in the feDisplacementMap filter. This issue re-enables a timing side-channel attack where cross-origin pixel values can be extracted by observing variations in rendering performance, bypassing the defense originally implemented for crbug.com/778506.
Root Cause Analysis
The vulnerability stems from two related issues:
-
Untainted Builtin Filter Effects: In
SVGFilterBuilder::SVGFilterBuilder()(third_party/blink/renderer/core/svg/graphics/filters/svg_filter_builder.cc), the builtin effects forFillPaint,StrokePaint, andSourceAlphaare created without propagating any origin-taint status:C++ builtin_effects_.insert(FilterInputKeywords::SourceAlpha(), MakeGarbageCollected<SourceAlpha>(source_graphic)); if (fill_flags) { builtin_effects_.insert(FilterInputKeywords::FillPaint(), MakeGarbageCollected<PaintFilterEffect>( source_graphic->GetFilter(), *fill_flags)); }The
FilterEffectbase class defaultsorigin_tainted_tofalse. While the canvas context may be tainted (e.g., by settingfillStyleto a cross-originCanvasPattern), andSourceGraphicis correctly marked as tainted, the newly createdPaintFilterEffectobjects forFillPaintandStrokePaintare never explicitly marked as tainted. Consequently, theirOriginTainted()methods incorrectly returnfalse. -
Incomplete Security Check in
FEDisplacementMap: The Filter Effects Module Level 1 specification requiresfeDisplacementMapto act as a pass-through filter if either the first or second input is origin-tainted to prevent timing attacks. However, inFEDisplacementMap::CreateImageFilter()(third_party/blink/renderer/platform/graphics/filters/fe_displacement_map.cc), the implementation only checks the second input:C++ // FEDisplacementMap must be a pass-through filter if // the origin is tainted. See: // https://drafts.fxtf.org/filter-effects/#fedisplacemnentmap-restrictions. if (InputEffect(1)->OriginTainted()) return color;It misses the check for
InputEffect(0)->OriginTainted().
Exploitation Scenario
If an attacker sets canvas.fillStyle to a cross-origin CanvasPattern and applies an SVG filter containing an <feDisplacementMap> element with in2="FillPaint", the cross-origin shader is carried into the FillPaint effect. Because FillPaint is incorrectly considered untainted, the security check in FEDisplacementMap is bypassed. The filter proceeds to use cross-origin pixel values as displacement vectors.
An attacker can perform a pixel-by-pixel extraction of cross-origin image content by measuring the time it takes to render a canvas with the displacement filter applied. Rendering timing varies depending on the displacement distance (driven by the victim pixel values), allowing for an information leak of cross-origin data (CWE-200).
Potential Reproduction Steps
Note: These are suggested steps to trigger the vulnerability. Tooling does not currently allow running arbitrary code to confirm the exploit.
-
Host an attacker-controlled page with an inline SVG filter:
XML <svg> <filter id="f"> <feDisplacementMap in="SourceGraphic" in2="FillPaint" xChannelSelector="R" yChannelSelector="G" scale="500"/> </filter> </svg> -
Load a cross-origin image without CORS:
img.src = 'https://victim.example/secret.png'; -
Upon image load, create a pattern and set it as the canvas
fillStyle(this taints the canvas context):JavaScript const ctx = canvas.getContext('2d'); const p = ctx.createPattern(img, 'repeat'); ctx.fillStyle = p; ctx.filter = 'url(#f)'; -
Repeatedly call
ctx.fillRect(0,0,1,1)while varyingSourceGraphicprobe patterns and measuring execution time usingperformance.now(). -
The render timing will depend on the R/G channel values of the cross-origin image at the displacement point. An attacker can binary-search for specific pixel values based on these timing variations.
Suggested Fix
-
Propagate Taint Status to Builtin Effects: Update the
SVGFilterBuilderconstructor to mark theSourceAlpha,FillPaint, andStrokePainteffects as tainted if the incomingsource_graphicis tainted or if the context flags contain cross-origin data. Alternatively, ensure thePaintFilterEffectitself evaluates taint based on the provided flags. -
Enforce Complete Security Check: Correct the implementation in
FEDisplacementMap::CreateImageFilter()to check both inputs as required by the specification:C++ if (InputEffect(0)->OriginTainted() || InputEffect(1)->OriginTainted()) return color;
Evaluated with Chrome root at commit: a9cbf6e8b275fe4147435aa905f3b7f5a656f5f0
Results from so far have been promising, but there can be wrong deductions. If this proves to be a false positive, please close as WAI; data from false positives will be used to improve accuracy over time. And please feel free to reach out to me directly if you have concerns or feedback on the project.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the builtin filter effects are constructed with the default untainted state and the displacement map filter checks only its second input for taint, so the specification's pass-through rule is not enforced.
Impact
Cross-origin image pixels could be leaked through timing measurements, though the report notes the exploit was not actually run and confirmed.
What the attacker needed
Victim visits attacker page; cross-origin image without CORS; precise timing measurement
The fix
The builder should mark the builtin effects as tainted when the source graphic is tainted, and the displacement map should treat the filter as a pass-through when either input is tainted.
How it was found
- Put an SVG filter with a displacement map using FillPaint as its second input on an attacker page.
- Load a cross-origin image without CORS.
- Create a pattern from the image and set it as the canvas fill style, which taints the context.
- Repeatedly draw a small rectangle while varying the probe pattern and timing the call.
- Infer pixel values from the timing differences, for example by binary search.
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.
A web page can normally draw an image from another site into a canvas, but the browser then marks that canvas as 'tainted' so the page cannot read the pixels back. This report says a browser filter used for SVG graphics forgets to carry that tainted mark into some of its inputs, so a page could still learn about those hidden pixels by timing how long drawing takes.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.