Skip to content
Misconfiguration Advisory Beginner CVE-2024-2628

Inappropriate implementation in Downloads (CVE-2024-2628)

The Chrome download UI on Android truncates long subdomains, pushing the real domain out of view. An attacker could use a long subdomain to make a malicious download appear to come from a trusted domain.

Ath3r1s Follow

Originally disclosed on Chrome VRP

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

Report description

File Download Origin Spoof Using Long Subdomain


Bug location

Which product or website have you found a vulnerability in?

Google Chrome (Android)


The problem

Please describe the technical details of the vulnerability

This vulnerability is similar to https://bugs.chromium.org/p/chromium/issues/detail?id=1281972. When the attacker provides the URL as follows: longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglo.longlong.google.com.ath3r1s.top:9998/app-debug.apk, there exists a UI Spoof in the component //*[@resource-id="com.android.chrome:id/message_container"]/android.widget.LinearLayout[1] of the com.google.android.apps.chrome.Main Activity. The long subdomain should be shifted to the left side inside the download section of the browser so that the main domain can be seen clearly. There are images and videos displayed in the attachment.

Please briefly explain who can exploit the vulnerability, and what they gain when doing so

Long subdomain is shifting the main domain to the right side of the browser which can be ab-used to mask the domain of the downloaded files.


The cause

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

120-0-6099-144

Is the security issue related to a crash?

No

Choose the type of vulnerability

Security UI Spoofing

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

Ath3r1s

The original report as published on the Chromium issue tracker, by Ath3r1s. 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. 5 min read.

Context

Google Chrome on Android shows a download notification and an in-browser download section when a file is fetched. That UI includes the source of the download, so the user can see which site the file came from before opening it. The security value of that label depends entirely on it being readable and unambiguous: if the displayed origin can be made to look like a trusted site while the file actually comes from somewhere else, the label stops being a defence.

This report describes a security UI spoofing issue in that download display. The researcher classifies it as "Security UI Spoofing" and locates it in the com.google.android.apps.chrome.Main activity, specifically in the view identified as:

Text
//*[@resource-id="com.android.chrome:id/message_container"]/android.widget.LinearLayout[1]

The affected product is Google Chrome for Android, and the report names version 120-0-6099-144 as the version where the issue was found. The researcher notes that the bug is similar to an earlier Chromium issue, 1281972.

Setup

No accounts, roles or special tooling are described. The preconditions that follow from the report are:

  1. Chrome for Android, version 120-0-6099-144.
  2. An attacker-controlled host that can serve a file, here an APK, and that can be reached on a chosen port.
  3. A URL crafted so that the attacker's domain appears after a long subdomain of a trusted-looking domain.

The researcher also refers to images and videos in the attachment showing the behaviour, but those attachments are not reproduced here.

Finding it

The report shows that when a download URL contains a very long subdomain, the download UI does not handle the origin label correctly. The long subdomain pushes the real, registrable domain off to the right, so the part of the host that the user can actually see is the attacker-controlled prefix rather than the domain that owns the file.

The report states the expected behaviour plainly: the long subdomain should be shifted to the left inside the download section of the browser so that the main domain can be seen clearly. Instead, the main domain is shifted to the right and can be masked.

Exploitation

Step 1: craft the download URL

The attacker supplies a URL of this form:

Text
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglo.longlong.google.com.ath3r1s.top:9998/app-debug.apk

The important parts are:

  • A very long leading label, longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglo, which consumes the horizontal space available in the download UI.
  • longlong.google.com, a trusted-looking string placed in the middle of the host so that it reads like a Google domain.
  • ath3r1s.top, the actual registrable domain that controls the content.
  • Port 9998, where the attacker serves the file.
  • The path app-debug.apk, the file being downloaded.

Because the host is read left to right, the long first label and the google.com fragment are what the user sees first, while the real domain sits further right and is pushed out of view.

Step 2: get the user to start the download

When the user downloads the file from that URL, Chrome for Android renders the download entry in the message_container view of the com.google.android.apps.chrome.Main activity. In that rendering, the long subdomain shifts the main domain to the right side of the download section, so the visible text suggests the file came from a Google domain rather than from ath3r1s.top.

Step 3: the user opens the file

The file in the example is an APK. A user who trusts the displayed origin may install it, believing it came from the domain shown in the download UI rather than from the attacker's host.

Root cause

The report does not describe the code responsible; it only states that the long subdomain shifts the main domain to the right. A long leading label therefore takes up the available width and pushes the meaningful part of the host, the main domain, to the right, out of the visible area. The report frames the correct behaviour as shifting the long subdomain to the left so the main domain remains clearly visible; the implementation does the opposite.

The report does not describe the code responsible, so the exact mechanism is not stated.

Impact

An attacker can mask the domain of a downloaded file in Chrome for Android's download UI. The report describes this as being ab-used to mask the domain of the downloaded files, which matters most for file types a user might install or run, such as the APK used in the example. The user has to start the download from the crafted URL and then act on the file; the spoof only affects what the download UI shows, not where the file actually comes from.

Fix

The behaviour it asks for is that the long subdomain be shifted to the left inside the download section so that the main domain is clearly visible, which is the property a fix should restore.

Variants to test

  1. Other long-label hosts in the download UI: try a URL whose first label is long enough to fill the width, followed by a trusted-looking domain fragment and the real domain. A positive result is a download entry where the real registrable domain is not visible.
  2. Different file types: repeat with an APK and with other file types the UI labels with an origin. A positive result is the same masking in each entry.
  3. Other Chrome surfaces that display an origin: check whether the same long-subdomain trick shifts the real domain out of view elsewhere. A positive result is any surface where the visible text suggests a domain other than the one serving the content.
  4. Different screen sizes and orientations: a narrower viewport should make the masking easier. A positive result is masking that appears or worsens as the available width shrinks.

Hunting notes

This kind of bug hides in UI that renders a host or origin string inside a fixed-width container: download entries, permission prompts, address displays and notification text. During recon, look for any place where a long label can be placed before a trusted-looking string, and check whether the registrable domain stays visible at the widths real users have. The signal is a display that parses the host correctly but lays it out so the meaningful part is pushed out of view.

The example URL downloads an APK, and the researcher points to an earlier Chromium issue with the same shape.

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. 8 min read.

What happened, in plain words

Chrome on Android shows you a small panel when you download a file. That panel tells you which website the file came from, so you can decide whether to trust it before you open it. The whole point of that label is that it is honest and easy to read. If someone can make the label look like it points at a trusted site while the file really comes from somewhere else, the label stops protecting you.

This report is about exactly that. A researcher found that a download address with a very long first part (a long subdomain) pushes the real website name off to the right, out of view. What you see instead is a trusted-looking name, even though the file is served from a different domain. The researcher calls this "Security UI Spoofing": the security information shown in the interface is misleading. The report does not state what change was made.

A quick comparison: imagine a parcel with a return address printed on it. If the printer runs out of space and only shows the first few words, you might read "from Google" when the rest of the address says something else entirely. The parcel is still from the other place; only the label is misleading. That is what happens here with the download panel.

Context

When Chrome on Android downloads a file, it shows a download section inside the browser that includes the source of the download. The idea is that you can glance at it and decide whether to open the file.

That label is only useful if it is readable and unambiguous. If the displayed origin can be made to look like a trusted site while the file actually comes from somewhere else, the label is no longer a defence.

The report places the problem in a specific screen of the Chrome app. On Android, apps are built from screens called activities. The one involved here is:

Text
com.google.android.apps.chrome.Main

Inside that activity, the affected piece of the interface is identified as:

Text
//*[@resource-id="com.android.chrome:id/message_container"]/android.widget.LinearLayout[1]

This is a way of pointing at one exact element on the screen, like giving directions to a single drawer in a filing cabinet. message_container is the name of the container that holds the download message, and LinearLayout[1] is the first layout block inside it. The report does not explain the selector further; it simply names the element where the spoof appears.

The affected product is Google Chrome for Android, and the report names version 120-0-6099-144 as the version where the issue was found. The researcher also notes that the bug is similar to an earlier Chromium issue, 1281972, meaning the same kind of problem had been seen before.

Setup

No accounts, roles or special tools are described. The conditions that follow from the report are:

  1. Chrome for Android, version 120-0-6099-144.
  2. A host controlled by the attacker that can serve a file, here an APK, and that can be reached on a chosen port.
  3. A URL crafted so that the attacker's domain appears after a long subdomain of a trusted-looking domain.

An APK is the installable package format for Android apps, the equivalent of a .exe on Windows. A port is a numbered channel on a server; web traffic normally uses 443 for HTTPS and 80 for HTTP, but any number can be used, and here the attacker picks 9998.

The researcher refers to images and videos in the attachment showing the behaviour, but those attachments are not reproduced here.

Finding it

The report shows that when a download URL contains a very long subdomain, the download interface does not handle the origin label correctly. The long subdomain pushes the real, registrable domain off to the right, so the part of the host you can actually see is the attacker-controlled prefix rather than the domain that owns the file.

A hostname is read left to right, with dots separating its parts. The rightmost part is the top-level domain (like .com or .top), and the part just before it is the registrable domain, the piece someone actually registers and controls. Everything to the left of that is a subdomain. So in mail.google.com, google.com is the registrable domain and mail is a subdomain. The registrable domain is the part that tells you who is really behind the address.

The report states the expected behaviour plainly: the long subdomain should be shifted to the left inside the download section of the browser so that the main domain can be seen clearly. Instead, the main domain is shifted to the right and can be masked.

Exploitation

Step 1: craft the download URL

The attacker supplies a URL of this form:

Text
longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglo.longlong.google.com.ath3r1s.top:9998/app-debug.apk

Reading it piece by piece:

  • longlonglonglonglonglonglonglonglonglonglonglonglonglonglonglo is a very long leading label. It is the first thing in the host and it eats up the horizontal space available in the download interface.
  • longlong.google.com is a trusted-looking string placed in the middle of the host so that it reads like a Google domain.
  • ath3r1s.top is the actual registrable domain that controls the content. This is where the file really comes from.
  • :9998 is the port where the attacker serves the file.
  • /app-debug.apk is the path, the file being downloaded.

Because a host is read left to right, the long first label and the google.com fragment are what you see first, while the real domain sits further right and is pushed out of view. The file is still served by ath3r1s.top; only the display is misleading.

Step 2: get the user to start the download

When the user downloads the file from that URL, Chrome for Android draws the download entry in the message_container view of the com.google.android.apps.chrome.Main activity. In that rendering, the long subdomain shifts the main domain to the right side of the download section, so the visible text suggests the file came from a Google domain rather than from ath3r1s.top.

This step matters because the spoof only appears once the download entry is drawn. The attacker does not need to break any encryption or steal anything; they just need the user to tap a link that starts a download.

Step 3: the user opens the file

The file in the example is an APK. A user who trusts the displayed origin may install it, believing it came from the domain shown in the download interface rather than from the attacker's host. That is the harm: the misleading label leads to a decision the user would not otherwise make.

Root cause

A long leading label therefore takes up the available width and pushes the meaningful part of the host, the main domain, to the right, out of the visible area. The report frames the correct behaviour as shifting the long subdomain to the left so the main domain remains clearly visible; the implementation does the opposite.

Impact

An attacker can mask the domain of a downloaded file in Chrome for Android's download interface. The report describes this as being ab-used to mask the domain of the downloaded files, which matters most for file types a user might install or run, such as the APK used in the example. The user has to start the download from the crafted URL and then act on the file; the spoof only affects what the download interface shows, not where the file actually comes from.

Fix

The behaviour it asks for is that the long subdomain be shifted to the left inside the download section so that the main domain is clearly visible, which is the property a fix should restore.

Variants to test

  1. Other long-label hosts in the download interface: try a URL whose first label is long enough to fill the width, followed by a trusted-looking domain fragment and the real domain. A positive result is a download entry where the real registrable domain is not visible.
  2. Different file types: repeat with an APK and with other file types the interface labels with an origin. A positive result is the same masking in each entry.
  3. Other Chrome surfaces that display an origin: check whether the same long-subdomain trick shifts the real domain out of view elsewhere. A positive result is any surface where the visible text suggests a domain other than the one serving the content.
  4. Different screen sizes and orientations: a narrower viewport should make the masking easier. A positive result is masking that appears or worsens as the available width shrinks.

Hunting notes

This kind of bug hides in interface elements that render a host or origin string inside a fixed-width container: download entries, permission prompts, address displays and notification text. During recon, look for any place where a long label can be placed before a trusted-looking string, and check whether the registrable domain stays visible at the widths real users have. The signal is a display that parses the host correctly but lays it out so the meaningful part is pushed out of view.

The example URL downloads an APK, and the researcher points to an earlier Chromium issue with the same shape.

Glossary

  • Activity: a single screen in an Android app, such as the main Chrome screen.
  • APK: the installable package format for Android apps.
  • Bounty: a payment a company makes to a researcher who reports a valid security issue.
  • CVE: a public identifier given to a known security vulnerability so people can refer to it unambiguously.
  • Domain: the name of a website, such as google.com.
  • Host / hostname: the full name used to reach a server, made of labels separated by dots, for example mail.google.com.
  • Label: one dot-separated part of a hostname, such as mail or google or com.
  • Origin: the combination of scheme, host and port that identifies where content comes from, for example https://example.com:443.
  • Port: a numbered channel on a server used to reach a particular service; web traffic normally uses 443 or 80.
  • Registrable domain: the part of a hostname that someone actually registers and controls, such as google.com in mail.google.com.
  • Security UI Spoofing: a vulnerability where the security information shown in an interface is made to look like something it is not, misleading the user.
  • Subdomain: a label placed to the left of the registrable domain, such as mail in mail.google.com.
  • Top-level domain: the rightmost part of a hostname, such as .com or .top.
  • Truncation: cutting off part of a string when there is not enough space to show all of it.
  • UI: user interface, the parts of a program a person sees and interacts with.
  • URL: the full address of a resource, including scheme, host, port and path.
  • Viewport: the visible area of a screen or window in which content is drawn.

More from Google Chrome

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.