Inappropriate implementation in CSS (CVE-2026-14146)
Blink's handling of the forced-color-adjust: preserve-parent-color property in Forced Colors mode resolves a parent link's visited-dependent colour and stores it in the child's unvisited colour slot. A malicious page could then read that colour via getComputedStyle and infer whether a URL is in the user's browsing history.
Google Chrome
Originally disclosed on Chrome VRP
- Fix shipped in 43 days
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: A potential cross-origin history leak exists in Blink's handling of the forced-color-adjust: preserve-parent-color CSS property when Forced Colors mode is active. The engine incorrectly resolves and stores a parent's visited-dependent color into a child's unvisited style slot during color inheritance. This allows malicious JavaScript to bypass :visited privacy protections and infer the user's browsing history using getComputedStyle().
Affected files:
third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc
Estimated timestamp from git blame: 2021-10-08
Summary
A potential cross-origin history leak exists in the implementation of the forced-color-adjust: preserve-parent-color CSS property when Forced Colors mode is active (e.g., Windows High Contrast mode). The vulnerability allows an attacker to programmatically determine if a URL has been visited by reading inherited style information that has bypassed visited-link protections.
Vulnerability Details
The issue originates in the Color::ApplyInherit method within third_party/blink/renderer/core/css/properties/longhands/longhands_custom.cc. This method handles how the color property is inherited from a parent element.
When forced-color-adjust: preserve-parent-color is applied and the browser is in Forced Colors mode, the element is intended to inherit its color from its parent's rendered color. The implementation performs this by eagerly resolving the parent's visited-dependent color:
void Color::ApplyInherit(StyleResolverState& state) const {
ComputedStyleBuilder& builder = state.StyleBuilder();
if (builder.ShouldPreserveParentColor()) {
builder.SetColor(StyleColor(
state.ParentStyle()->VisitedDependentColor(GetCSSPropertyColor())));
} else {
builder.SetColor(state.ParentStyle()->Color());
}
// ...
}
The critical flaw is that state.ParentStyle()->VisitedDependentColor(...) evaluates to the actual rendered color of the parent, which includes the effects of the :visited pseudo-class if the parent is a link. This resolved color is then stored directly into the child element's standard color slot via builder.SetColor().
In Blink's style system, this standard color slot is exclusively meant for the unvisited style. When JavaScript calls getComputedStyle(element).color, the bindings internally call Color::CSSValueFromComputedStyleInternal with allow_visited_style = false.
Because forced_color_adjust is kPreserveParentColor and not kAuto, ComputedStyle::ShouldForceColor() evaluates to false. Consequently, the code falls back to reading the unvisited slot via style.GetCurrentColor(). Since the standard slot was previously poisoned with the visited color during inheritance, the :visited state is leaked across origins to JavaScript.
Potential Attack Steps
Note: These are suggested/potential steps based on code analysis, as our tooling agent cannot execute code to verify the exploit dynamically.
An attacker could potentially detect if a user has visited a specific URL using the following sequence:
- Create a malicious webpage containing an anchor element (
<a>) with itshrefpointing to a target URL (e.g.,https://example.com). - Inside the anchor, insert a child element (e.g.,
<span>) and apply the CSS propertyforced-color-adjust: preserve-parent-color. - The attacker's script checks if Forced Colors mode is active (or passively waits for users with this accessibility setting).
- The script calls
window.getComputedStyle(spanElement).colorto read the inherited color of the child element. - If the returned color matches the anchor's expected
:visitedcolor rather than its default unvisited color, the attacker deterministically concludes the URL is in the user's history.
Suggested Fix
The root cause is that the standard color slot is being populated with a visited-dependent color. The unvisited and visited colors should remain strictly separated in the ComputedStyleBuilder.
In Color::ApplyInherit, when ShouldPreserveParentColor() is true, it should only retrieve the parent's unvisited forced color (e.g., bypassing the VisitedDependentColor wrapper) and store that via builder.SetColor().
The inheritance of the visited forced color is already naturally handled (or should be handled) by InternalVisitedColor::ApplyInherit, which correctly sets builder.SetInternalVisitedColor(...).
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.
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 inheritance code for preserve-parent-color reads the parent's visited-dependent colour and writes it into the child's unvisited colour slot, which getComputedStyle then exposes.
Impact
A page could learn whether a user has visited a given URL, but only when the user has Forced Colors mode enabled; the report is based on code analysis and was not verified dynamically.
What the attacker needed
Victim uses Forced Colors mode; victim visits attacker's page; target URL known to attacker
The fix
The inheritance should take only the parent's unvisited forced colour and store it in the standard slot, leaving the visited colour to the internal visited colour handling.
How it was found
- Create a page with an anchor pointing at the target URL.
- Put a child element inside the anchor and apply forced-color-adjust: preserve-parent-color to it.
- Check whether Forced Colors mode is active, or wait for a user who has it enabled.
- Read the child's colour with getComputedStyle.
- Compare the colour with the expected visited colour to decide if the URL is in history.
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.
Browsers deliberately hide whether you have visited a link, so other websites cannot learn your browsing history. Here, a CSS accessibility setting for high-contrast mode caused the visited colour of a link to be copied into a child element's normal colour, which a script can read. That let a page work out if you had visited a particular site.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.