Skip to content
Access control Write-up Beginner

Huawei LTE USB Stick E3372: From File Overwrite to Code Execution

A file installed by the Huawei HiLink software for the E3372 USB stick had weak permissions, allowing any authenticated local user to overwrite it. An attacker could replace the file with their own code, which would then run as another user when that user inserted the dongle and logged on.

Martin Rakhmanov Follow

Published on trustwave.com

Change theme to light

Martin Rakhmanov (@mrakhmanov), on trustwave.com

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

Context

Huawei's mobile broadband service lets a computer reach the Internet over cellular networks through a small USB dongle. The device covered here is the Huawei LTE USB Stick E3372, which looks like a USB thumb drive and ships with macOS software called HiLink. The workflow is the familiar one: plug the dongle in, install the bundled software, and you are online, provided the dongle has a SIM card with a working data plan.

At the time of writing the device could be bought in Germany and Italy directly from Huawei, and new and used units were widely available on eBay and other online retailers.

The HiLink installer places a helper application on disk that is launched when a user logs on and inserts the dongle. That helper opens a web browser pointing at the device management interface. The security question is therefore who is allowed to modify that helper, because whatever it contains runs in the context of the user who triggers it.

Setup

The analysis was a quick look at the software installed by the HiLink package on macOS. No special tooling, accounts or versions are described beyond the installed file layout and the permissions the installer sets. The relevant artefact is this path:

Text
/Library/StartupItems/MobileBrServ/mbbserviceopen.app/Contents/MacOS/mbbserviceopen

The issue affects multiuser environments: more than one account on the same computer, with the HiLink software installed.

Finding it

During the quick analysis, one of the installed files stood out because it was missing appropriate access control settings. In plain terms, any authenticated user on the computer can overwrite the file above. The installer's own permissions on that file are what the researcher captured:

DOC_17995_6a0133f264aa62970b0278802af971200d
DOC_17995_6a0133f264aa62970b0278802af971200d From the original on trustwave.com

The file is not incidental. When a user logs on to the computer and inserts the dongle, it is executed automatically to open a web browser with the device management interface. A file that any local account can rewrite, and that is executed on behalf of another user at logon, crosses a user boundary.

Exploitation

Step 1: Identify the writable, auto-executed file

The helper at the path above is writable by any authenticated user. The installer sets permissions that allow this, as shown in the screenshot of the installed file's permissions.

Step 2: Replace the file with attacker code

A malicious user overwrites the helper with their own desired code. No special technique is needed beyond the write access the permissions already grant.

Step 3: Wait for a legitimate user

The attacker then waits for a legitimate user to start using the cellular data service through the Huawei device. On logon with the dongle inserted, the replaced file is executed automatically, and the attacker's code runs in that user's context.

There is no request, payload or command shown in the report for these steps; the mechanism is the file replacement itself.

Root cause

One of the installed files is missing appropriate access control settings. Because the file lives in a shared location and is launched automatically at logon when the dongle is inserted, any authenticated local user can substitute its contents. The report describes the missing access control settings as the weakness.

Impact

The issue affects multiuser environments where one user account can execute code as another user without the latter knowing. In the described flow, the replaced file is executed when the legitimate user logs on with the dongle inserted. The report frames this as a way for malicious actors to obtain an initial foothold that triggers the installation of more robust malware.

Fix

Huawei released a patch on 2 June 2021, the day the blog was published. The guidance is to upgrade the affected HiLink products tool to version 22.001.34.02.03 or the latest stable version. Huawei's security advisory is referenced at:

Text
https://www.huawei.com/en/psirt/security-advisories/huawei-sa-20210602-01-permission-en

The report does not state what the patch changes in the installer's permission handling.

Disclosure timeline

  1. 7 October 2020: initial email to Huawei at multiple security and support addresses; no response.
  2. 15 December 2020: Huawei U.S. support contacted by phone to find the right contact; a new support contact email address was provided.
  3. 16 December 2020: Trustwave attempted to reach the provided addresses multiple times; no response.
  4. In the last 24 hours before publishing, Huawei contacted Trustwave SpiderLabs and noted that Trustwave had not reached the Huawei PSIRT alias, [redacted] With the correct team in touch, the pertinent information was provided. Huawei released a patch on 2 June 2021.

Variants to test

  1. Other vendor installers with shared helper binaries. Inspect files installed under shared system locations that are launched at logon or on device insertion. A positive result is a helper that an unprivileged account can overwrite and that runs in another user's session.
  2. Auto-launch paths tied to removable devices. Look for startup items or agents triggered when a USB device is attached. A positive result is a writable executable on that path whose replacement executes without any further user action beyond plugging the device in.
  3. Installer-set permissions on application bundles. Compare the ownership and mode of installed binaries against the account that runs them. A positive result is a binary writable by accounts other than its owner or the executing user.
  4. Multiuser escalation through shared software. On a machine with two accounts, install the vendor software as one user and attempt to modify its components as the other. A positive result is a modification that later executes in the first user's context.

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

What happened, in plain words

Huawei makes a small USB device called the LTE USB Stick E3372. It looks like a USB thumb drive and lets a computer connect to the internet over a mobile phone network, as long as the stick has a SIM card with a data plan. The stick comes with software for macOS called HiLink. You plug the stick in, install HiLink, and you are online.

When HiLink is installed, it puts a small helper program on the computer. That helper runs automatically when a user logs on and the stick is plugged in. Its job is to open a web browser showing the device's management page. The problem is that the installer gave this helper file permissions that let any authenticated user on the computer overwrite it. So another user on the same machine can replace the helper with their own program. When the legitimate user next logs on with the stick inserted, that program runs with the legitimate user's rights. One user can run code as another user without that user knowing.

Trustwave SpiderLabs found the issue, tried to tell Huawei, and eventually Huawei released a patch on 2 June 2021. The fixed version of the HiLink tool is 22.001.34.02.03 or later.

The device and the software

The Huawei LTE USB Stick E3372 is a mobile broadband dongle. "Mobile broadband" means internet access over the cellular network, the same network your phone uses for data. The stick is small enough to carry, and it works with any computer that has a USB port. You need a SIM card with a working data plan inside the stick.

At the time of writing, you could buy the device in Germany and Italy directly from Huawei, and new and used units were widely available on eBay and other online retailers.

The software that comes with it is called HiLink. It is installed on macOS. Part of what HiLink installs is a helper application that starts when a user logs on and inserts the dongle. That helper opens a web browser pointing at the device's management interface, which is the web page where you can see signal strength, send texts, and change settings on the stick.

Because the helper runs automatically, the important question is: who is allowed to change that helper file? Whatever is inside it runs with the rights of the user who triggers it. If another user can change the file, they can decide what code runs as the victim.

How the analysis was done

The researcher did a quick look at the software that the HiLink package installs on macOS. The report does not describe any special tools, accounts, or versions beyond the installed file layout and the permissions the installer sets. The file that matters is at this path:

Text
/Library/StartupItems/MobileBrServ/mbbserviceopen.app/Contents/MacOS/mbbserviceopen

This is a file path on macOS. /Library is a shared folder for system-wide items, not a user's home folder. StartupItems is a folder macOS uses for programs that start at boot or login. MobileBrServ is a folder created by the Huawei software. Inside it is an application bundle called mbbserviceopen.app. An application bundle is a folder that macOS treats as a single app. Inside that bundle, Contents/MacOS/ holds the actual executable file, and mbbserviceopen is that executable. So the path points to the program that gets run.

The issue affects multiuser machines: more than one account on the same computer, with the HiLink software installed.

Finding the problem

During the quick analysis, one installed file stood out because it was missing appropriate access control settings. In plain terms, any authenticated user on the computer can overwrite the file above. "Authenticated user" means someone who has logged in to the computer with a valid account.

The installer's own permissions on that file are what the researcher captured:

DOC_17995_6a0133f264aa62970b0278802af971200d
DOC_17995_6a0133f264aa62970b0278802af971200d From the original on trustwave.com

The screenshot shows the permissions set by the installer. Permissions on macOS (and other Unix-like systems) decide who can read, write, or execute a file.

This file is not incidental. When a user logs on to the computer and inserts the dongle, the file is executed automatically to open a web browser with the device management interface. A file that any local account can rewrite, and that is executed on behalf of another user at logon, crosses a user boundary. A privilege boundary is the line between what one user is allowed to do and what another user is allowed to do. If you can change a file that runs as someone else, you can cross that line.

Exploitation

Step 1: Identify the writable, auto-executed file

The helper at the path above is writable by any authenticated user. The installer sets permissions that allow this, as shown in the screenshot of the installed file's permissions. The point is that the permissions are too open.

Step 2: Replace the file with attacker code

A malicious user overwrites the helper with their own desired code. No special technique is needed beyond the write access the permissions already grant. They simply save their program over the existing file. The report does not include any request, payload, or command for this step; the mechanism is the file replacement itself.

Step 3: Wait for a legitimate user

The attacker then waits for a legitimate user to start using the cellular data service through the Huawei device. When that user logs on with the dongle inserted, the replaced file is executed automatically, and the attacker's code runs in that user's context. "In that user's context" means with that user's permissions and access to their files and data. The victim does not need to do anything special beyond logging in and plugging in the stick.

There is no request, payload, or command shown in the report for these steps; the mechanism is the file replacement itself.

Root cause

One of the installed files is missing appropriate access control settings. Because the file lives in a shared location and is launched automatically at logon when the dongle is inserted, any authenticated local user can substitute its contents. The report describes the missing access control settings as the weakness. Signature verification would check that the file is still the one Huawei signed; an ownership check would confirm the file belongs to the right user. Neither is mentioned, so the permission setting is the whole of the described weakness.

Impact

The issue affects multiuser environments where one user account can execute code as another user without the latter knowing. In the described flow, the replaced file is executed when the legitimate user logs on with the dongle inserted. The report frames this as a way for malicious actors to obtain an initial foothold that triggers the installation of more robust malware. An initial foothold means a first way into a system, from which an attacker can later install more powerful tools.

Fix

Huawei released a patch on 2 June 2021, the day the blog was published. The guidance is to upgrade the affected HiLink products tool to version 22.001.34.02.03 or the latest stable version. Huawei's security advisory is referenced at:

Text
https://www.huawei.com/en/psirt/security-advisories/huawei-sa-20210602-01-permission-en

The report does not state what the patch changes in the installer's permission handling.

Disclosure timeline

  1. 7 October 2020: initial email to Huawei at multiple security and support addresses; no response.
  2. 15 December 2020: Huawei U.S. support contacted by phone to find the right contact; a new support contact email address was provided.
  3. 16 December 2020: Trustwave attempted to reach the provided addresses multiple times; no response.
  4. In the last 24 hours before publishing, Huawei contacted Trustwave SpiderLabs and noted that Trustwave had not reached the Huawei PSIRT alias, [redacted] With the correct team in touch, the pertinent information was provided. Huawei released a patch on 2 June 2021.

Variants to test

  1. Other vendor installers with shared helper binaries. Inspect files installed under shared system locations that are launched at logon or on device insertion. A positive result is a helper that an unprivileged account can overwrite and that runs in another user's session.
  2. Auto-launch paths tied to removable devices. Look for startup items or agents triggered when a USB device is attached. A positive result is a writable executable on that path whose replacement executes without any further user action beyond plugging the device in.
  3. Installer-set permissions on application bundles. Compare the ownership and mode of installed binaries against the account that runs them. A positive result is a binary writable by accounts other than its owner or the executing user.
  4. Multiuser escalation through shared software. On a machine with two accounts, install the vendor software as one user and attempt to modify its components as the other. A positive result is a modification that later executes in the first user's context.

Glossary

  • Access control settings: Rules that decide who can read, write, or run a file or use a resource.
  • Authenticated user: Someone who has logged in to the computer with a valid account.
  • Binary: An executable file, a program that the computer can run.
  • Code execution: Running a program or instructions on a computer.
  • Context (user context): The set of permissions and identity under which a program runs; for example, running as a particular user.
  • Dongle: A small device that plugs into a computer port, here a USB stick that provides mobile internet.
  • Executable: A file that can be run as a program.
  • Helper application: A small program that does a specific job for a larger application or the system.
  • HiLink: The name of Huawei's software for managing the USB stick on a computer.
  • Initial foothold: A first way into a system, from which an attacker can later do more.
  • Installer: A program that sets up other software on a computer.
  • Local privilege escalation: A situation where a user with ordinary rights can gain the rights of another user or an administrator on the same machine.
  • macOS: Apple's operating system for Mac computers.
  • Malware: Software designed to cause harm or gain unauthorised access.
  • Mobile broadband: Internet access over a cellular network, like the data connection on a phone.
  • Multiuser environment: A computer with more than one user account.
  • Patch: A software update that fixes a problem.
  • Permissions: Rules on a file that say who can read, write, or execute it.
  • Privilege boundary: The line between what one user is allowed to do and what another is allowed to do.
  • PSIRT: Product Security Incident Response Team, the group in a company that handles security reports.
  • Root cause: The underlying reason a problem exists.
  • Signature verification: Checking that a file is the one the vendor signed, to make sure it has not been changed.
  • SIM card: A small card that identifies a mobile subscriber and allows cellular service.
  • Startup item: A program that starts automatically when the computer boots or a user logs in.
  • USB: Universal Serial Bus, the common connector for attaching devices to a computer.
  • Vulnerability: A weakness in software that can be used to cause harm.

More by Martin Rakhmanov

View all

2 more disclosed reports, best first.

More from Huawei

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.