Skip to content
RCE Write-up Advanced

Our Experiences Participating in Microsoft’s Azure Sphere Bounty Program

The researchers found multiple vulnerabilities in Microsoft's Azure Sphere platform, including a symlink issue allowing file access outside the application package, a character device enabling flash memory modification, privilege escalation bugs, and a certificate management flaw allowing device re-claiming. These could lead to code execution, privilege escalation, and bypass of security restrictions.

McAfee Advanced Threat Research (ATR) Follow

Published on mcafee.com

Bounty$160,000 View original

From June to August, part of the McAfee Advanced Threat Research (ATR) team participated in Microsoft’s Azure Sphere Research Challenge. Our research resulted in reporting multiple vulnerabilities classified by Microsoft as “important” or “critical” in the platform that, to date, have qualified for over $160,000 USD…

Philippe Laulheret, on mcafee.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. 7 min read.

Context

Azure Sphere is a hardened IoT device with a secure communication link to the cloud. Microsoft developed it over several years and it reached general availability in early 2020. It was designed and built from scratch to make every aspect of it as secure as possible, following Microsoft's security model. The device runs a hardened Linux operating system on an ARM processor.

In late May 2020 Microsoft started a new bug bounty program for the platform, the Azure Sphere Research Challenge. Microsoft invited a select group of partners and hackers to try to defeat the device's security measures. The Azure Sphere team defined several research scenarios that would test the security model and qualify for an increased payout compared with the regular Azure Bug Bounty program. These scenarios ranged from bypassing certain security measures to executing code in the hardware-enabled secure core of the device.

From June to August, part of the McAfee Advanced Threat Research (ATR) team took part in the challenge. This article is a high-level overview of the program, why the team joined, and a brief description of the findings. A detailed technical walkthrough of the findings is published separately as a white paper, "Prisoner of Azure Kaban".

Setup

The findings touch the device itself, its application packaging and privilege model, and the pre-production and production environments involved in device claiming. The team worked against the platform's security model as a whole: application packaging, the Application Manager, the privilege model around the azcore component, the Linux Security Module (LSM), and device claiming and certificate management.

No specific tooling, account setup or version numbers are given in the report. The relevant preconditions appear in the individual findings: the ability to submit or deploy an application package, local access at the sys privilege level for some escalation paths, and, for the certificate issue, physical access to a device.

Finding it

The team approached Azure Sphere as a new research target built from the ground up with security in mind, with very little prior research available. The platform was interesting because it shows what the IoT space may look like as legacy platforms are phased out, and because finding critical bugs in it would help make the space more resistant to threats.

Rather than a single flaw, the research produced multiple bugs that Microsoft rated Important or Critical. They cluster around a few themes: what an application package is allowed to contain and reference, how the Application Manager mounts and unmounts components, how privileges are dropped for azcore, and how device capabilities are issued across pre-production and production environments.

Exploitation

The report lists the findings with their Microsoft rating and bounty amount. It does not include the individual proof-of-concept requests, payloads or command output; those are in the separate white paper. What follows is each finding as described.

Step 1: Symlink in an application package (Important, Security Feature bypass, $3,300)

The inclusion of a symlink in an application package allows referencing files outside of the application package mount point. In other words, the packaging format accepts a link that resolves beyond the directory the package is mounted at, giving access to files the application should not reach.

Step 2: Character device in an application package (Critical, RCE, $48,000)

The inclusion of a "character device" in an application package allows direct interaction with a part of the flash memory. That interaction eventually leads to the modification of critical system files and further exploitation, a packaging weakness that Microsoft rated as remote code execution.

Step 3: uid_map processing bugs (Important, EoP, $11,000)

Multiple bugs in how uid_map files are processed allow elevation of privilege to the sys user.

Step 4: Tricking Application Manager into mounting a rogue azcore (Important, EoP, $11,000)

A user with sys privileges can trick the Application Manager into unmounting azcore and mounting a rogue binary in its place. Triggering a core dump of a running process then executes the rogue binary with full capabilities and root privileges. The report attributes this to improper handling of permissions in the LSM.

Step 5: Bypassing capability restrictions through privilege dropping (Critical, EoP, $48,000)

Further problems in the privilege dropping of azcore lead to the complete bypass of Azure Sphere capability restrictions.

Step 6: Re-claiming a device through certificate management (Critical, EoP, $48,000)

Due to improper certificate management, it is possible to re-claim a device on the Azure Sphere pre-production server and obtain a valid capability file that works in the production environment. That capability file can be used to re-enable application development mode on a finalised device, including one claimed by a third party. Deploying the capability file requires physical access to the device.

The chain

Through the bugs found, the team was able to build a full chain exploit from a locked device to root access. The report does not publish the chain itself, only this outcome.

Root cause

The findings point to weaknesses at the boundaries between components rather than in a single function:

  • A symlink in a package can reference files outside the package mount point, and a character device in a package allows direct interaction with part of the flash memory.
  • The processing of uid_map files is flawed in multiple ways, allowing a process to reach the sys user.
  • The Application Manager's unmount and mount handling for azcore can be influenced by a sys-privileged user, and the LSM does not properly handle permissions, so a rogue binary is executed with full capabilities and root when a core dump is triggered.
  • Privilege dropping for azcore is incomplete, which defeats the capability restrictions entirely.
  • Certificate management allows a device to be re-claimed on the pre-production server and to yield a capability file accepted in production.

Some of these are described by the report as improper handling of permissions or improper certificate management; the exact code-level mistakes are covered in the white paper, not here.

Impact

An attacker able to include a symlink in a package could reference files outside the mount point; one able to include a character device could interact with flash memory, modify critical system files and execute code. A local user at sys privilege could escalate to root through the azcore mount trick and, separately, bypass Azure Sphere capability restrictions. Someone with physical access to a device could re-enable application development mode on a finalised device, even one claimed by a third party, by deploying a capability file obtained from the pre-production server.

Combined, the bugs allowed a full chain from a locked device to root access. The report notes that the platform retains other security features, such as remote attestation and the hardware-enabled secure core, that were still holding strong.

Microsoft classified the reported vulnerabilities as Important or Critical. To date they have qualified for over $160,000 USD in bounty awards, scheduled to be contributed to the ACLU ($100,000), St. Jude's Children's Research Hospital ($50,000) and PDX Hackerspace (approximately $20,000). The team decided from the start to donate any award to charity.

Fix

The report does not describe the specific fixes Microsoft made to the platform. It notes only that Microsoft published two summary blogs on the Azure Sphere Bounty Program as a whole, including McAfee's efforts and findings, on the MSRC Blog and the Azure Sphere Core Team Blog.

Variants to test

  1. Package entries that reference outside the mount point. Submit packages containing symlinks and check whether a link resolves to a path outside the package mount point; a positive result is reading or executing a file the package should not reach.
  2. Device nodes in packages. Include character devices in a package and observe whether the application can interact with flash memory or other hardware directly; a positive result is a write to a region that changes critical system files.
  3. uid_map parsing. Feed malformed or edge-case uid_map files and check whether the resulting process runs as sys; a positive result is a privilege level the caller should not obtain.
  4. Component remounting. As a sys-privileged user, attempt to influence the Application Manager into unmounting a core component and mounting a replacement, then trigger a core dump; a positive result is execution of the replacement with full capabilities and root.
  5. Privilege dropping. Exercise the paths where azcore drops privileges and check whether capability restrictions can be bypassed; a positive result is an operation the capability model should forbid.
  6. Cross-environment capability files. Try claiming a device on a pre-production or staging server and using the resulting capability file against production; a positive result is re-enabling development mode on a finalised device, including one claimed by someone else. Remember that deploying the file requires physical access.

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

What happened, in plain words

Microsoft makes a small computer called Azure Sphere. It is designed for the "internet of things" (IoT): everyday objects such as sensors, meters or home appliances that are connected to the internet. Azure Sphere is built to be very hard to break into, and it talks securely to Microsoft's cloud services. In 2020 Microsoft invited a small number of outside security teams to try to break it, as part of a bug bounty programme called the Azure Sphere Research Challenge. A bug bounty is a scheme where a company pays people for finding and reporting security flaws, so the company can fix them before criminals find them.

The McAfee Advanced Threat Research (ATR) team took part between June and August. They found several bugs that Microsoft rated Important or Critical. Through the bugs they found, the team was able to build a full chain exploit from a locked device to root access. Microsoft awarded more than $160,000 USD, and the team had decided from the start to give the money to charity: $100,000 to the ACLU, $50,000 to St. Jude's Children's Research Hospital and about $20,000 to PDX Hackerspace.

This article explains the findings for someone who has never studied security. It covers what Azure Sphere is, why the team joined, each bug in turn, what caused it, what an attacker could do with it, and what the report does and does not say about fixes. It also lists the kinds of tests that similar platforms should be subjected to.

What Azure Sphere is, and what the challenge was

Azure Sphere is a hardened IoT device with a secure communication link to the cloud. "Hardened" means it has been deliberately built with many layers of protection, rather than a normal computer with security added afterwards. Microsoft developed it over several years and it became generally available in early 2020. It was designed and built from scratch to make every aspect of it as secure as possible, following Microsoft's security model. The device runs a hardened Linux operating system on an ARM processor. Linux is the same family of operating systems used on many servers and Android phones; ARM is a processor design common in phones and small devices.

In late May 2020 Microsoft started a new bug bounty programme for the platform, the Azure Sphere Research Challenge. Microsoft invited a select group of partners and hackers to try to defeat the device's security measures. The Azure Sphere team defined several research scenarios that would test the security model and qualify for an increased payout compared with the regular Azure Bug Bounty programme. These scenarios ranged from bypassing certain security measures to executing code in the hardware-enabled secure core of the device. The secure core is a separate, protected part of the chip that is meant to keep working safely even if the main part is compromised.

From June to August, part of the McAfee Advanced Threat Research (ATR) team took part in the challenge. This article is a high-level overview of the programme, why the team joined, and a brief description of the findings. A detailed technical walkthrough of the findings is published separately as a white paper, "Prisoner of Azure Kaban".

Why the team joined

The team approached Azure Sphere as a new research target built from the ground up with security in mind, with very little prior research available. The platform was interesting because it shows what the IoT space may look like as legacy platforms are phased out, and because finding critical bugs in it would help make the space more resistant to threats. In other words, they wanted to learn how a modern, security-first IoT device is put together, and to help make the next generation of connected devices safer.

How the research was set up

The findings touch the device itself, its application packaging and privilege model, and the pre-production and production environments involved in device claiming. A pre-production server is a test version of a service, used before the real one; the production environment is the real service that ordinary customers use. The team worked against the platform's security model as a whole: application packaging, the Application Manager, the privilege model around the azcore component, the Linux Security Module (LSM), and device claiming and certificate management.

Some of these terms need a plain explanation:

  • An application package is a bundle of files that you install on the device, rather like a zip file or an app installer on a phone. The device mounts it, meaning it makes its contents available at a particular place in the file system.
  • The Application Manager is the part of the system that installs, starts, stops and removes applications.
  • azcore is a core component of the Azure Sphere software. It runs with high privileges, so bugs around it are serious.
  • The Linux Security Module (LSM) is a part of Linux that lets the system enforce extra rules about what programs are allowed to do, on top of the normal user permissions.
  • Device claiming is the process of registering a device to an owner, so that only that owner can manage it.
  • Certificates are digital documents that prove identity, a bit like a passport for a computer.

No specific tooling, account setup or version numbers are given in the report. The relevant preconditions appear in the individual findings: the ability to submit or deploy an application package, local access at the sys privilege level for some escalation paths, and, for the certificate issue, physical access to a device.

The findings

Rather than a single flaw, the research produced multiple bugs that Microsoft rated Important or Critical. They cluster around a few themes: what an application package is allowed to contain and reference, how the Application Manager mounts and unmounts components, how privileges are dropped for azcore, and how device capabilities are issued across pre-production and production environments.

The report lists the findings with their Microsoft rating and bounty amount. It does not include the individual proof-of-concept requests, payloads or command output; those are in the separate white paper. What follows is each finding as described.

Step 1: Symlink in an application package (Important, Security Feature bypass, $3,300)

The inclusion of a symlink in an application package allows referencing files outside of the application package mount point. A symlink (symbolic link) is a shortcut file that points to another file or folder, like a signpost saying "the real file is over there". The mount point is the folder where the package's contents are made available. If a package can contain a symlink that points outside that folder, the application can reach files it should never see. This is a security feature bypass because a protection (keeping the app inside its own folder) is circumvented.

Step 2: Character device in an application package (Critical, RCE, $48,000)

The inclusion of a "character device" in an application package allows direct interaction with a part of the flash memory. That interaction eventually leads to the modification of critical system files and further exploitation, a packaging weakness that Microsoft rated as remote code execution.

A character device is a special file that represents a piece of hardware, such as a disk or a serial port. Normally an application should not be able to put such a file into its package and then talk directly to the hardware. Flash memory is the storage chip that holds the device's software. If an app can write to the part of flash that holds critical system files, it can change the system itself. Remote code execution (RCE) means an attacker can make the device run their own code, often from a distance.

Step 3: uid_map processing bugs (Important, EoP, $11,000)

Multiple bugs in how uid_map files are processed allow elevation of privilege to the sys user.

A uid_map file is a configuration file used by Linux to translate user identifiers between different contexts, for example inside a container (an isolated mini-system) and outside it. If the system processes these files incorrectly, a program can end up running as a more powerful user than it should. Elevation of privilege (EoP) means gaining rights you were not meant to have. The sys user is a privileged account on Azure Sphere, though not the most powerful one (that is root).

Step 4: Tricking Application Manager into mounting a rogue azcore (Important, EoP, $11,000)

A user with sys privileges can trick the Application Manager into unmounting azcore and mounting a rogue binary in its place. Triggering a core dump of a running process then executes the rogue binary with full capabilities and root privileges. The report attributes this to improper handling of permissions in the LSM.

Unmounting means detaching a component so its files are no longer available at their usual place. A rogue binary is a malicious program. A core dump is a file the system writes when a program crashes, to help debugging; if the system is not careful, it may run a program while producing that file. Full capabilities and root privileges mean the program runs with the highest level of trust on the device. The LSM is supposed to stop this kind of substitution, but here its permission handling was faulty.

Step 5: Bypassing capability restrictions through privilege dropping (Critical, EoP, $48,000)

Further problems in the privilege dropping of azcore lead to the complete bypass of Azure Sphere capability restrictions.

Privilege dropping is when a program that starts with high rights deliberately gives some of them up before doing risky work, so that a mistake cannot cause too much damage. Capabilities are fine-grained permissions, such as "may use the network" or "may write to this file". If the dropping is incomplete, the restrictions can be bypassed entirely.

Step 6: Re-claiming a device through certificate management (Critical, EoP, $48,000)

Due to improper certificate management, it is possible to re-claim a device on the Azure Sphere pre-production server and obtain a valid capability file that works in the production environment. That capability file can be used to re-enable application development mode on a finalised device, including one claimed by a third party. Deploying the capability file requires physical access to the device.

A capability file is a digital permission slip. Development mode is a state that lets developers load their own applications onto a device; on a finished, finalised device it is meant to be switched off. If an attacker can get a valid permission slip from the test server and use it on the real one, they can turn development mode back on, even on a device that someone else has claimed. The catch is that they need to be physically holding the device to deploy the file.

The chain

Through the bugs found, the team was able to build a full chain exploit from a locked device to root access. A chain exploit means using several smaller weaknesses one after another, like a series of doors each opened by the previous one. The report does not publish the chain itself, only this outcome.

Root cause

The findings point to weaknesses at the boundaries between components rather than in a single function:

  • A symlink in a package can reference files outside the package mount point, and a character device in a package allows direct interaction with part of the flash memory.
  • The processing of uid_map files is flawed in multiple ways, allowing a process to reach the sys user.
  • The Application Manager's unmount and mount handling for azcore can be influenced by a sys-privileged user, and the LSM does not properly handle permissions, so a rogue binary is executed with full capabilities and root when a core dump is triggered.
  • Privilege dropping for azcore is incomplete, which defeats the capability restrictions entirely.
  • Certificate management allows a device to be re-claimed on the pre-production server and to yield a capability file accepted in production.

Some of these are described by the report as improper handling of permissions or improper certificate management; the exact code-level mistakes are covered in the white paper, not here.

Impact

An attacker able to include a symlink in a package could reference files outside the mount point; one able to include a character device could interact with flash memory, modify critical system files and execute code. A local user at sys privilege could escalate to root through the azcore mount trick and, separately, bypass Azure Sphere capability restrictions. Someone with physical access to a device could re-enable application development mode on a finalised device, even one claimed by a third party, by deploying a capability file obtained from the pre-production server.

Combined, the bugs allowed a full chain from a locked device to root access. The report notes that the platform retains other security features, such as remote attestation and the hardware-enabled secure core, that were still holding strong. Remote attestation is a way for a device to prove to a remote service that it is running the software it is supposed to be running.

Microsoft classified the reported vulnerabilities as Important or Critical. To date they have qualified for over $160,000 USD in bounty awards, scheduled to be contributed to the ACLU ($100,000), St. Jude's Children's Research Hospital ($50,000) and PDX Hackerspace (approximately $20,000). The team decided from the start to donate any award to charity.

Fix

The report does not describe the specific fixes Microsoft made to the platform. It notes only that Microsoft published two summary blogs on the Azure Sphere Bounty Programme as a whole, including McAfee's efforts and findings, on the MSRC Blog and the Azure Sphere Core Team Blog.

Variants to test

  1. Package entries that reference outside the mount point. Submit packages containing symlinks and check whether a link resolves to a path outside the package mount point; a positive result is reading or executing a file the package should not reach.
  2. Device nodes in packages. Include character devices in a package and observe whether the application can interact with flash memory or other hardware directly; a positive result is a write to a region that changes critical system files.
  3. uid_map parsing. Feed malformed or edge-case uid_map files and check whether the resulting process runs as sys; a positive result is a privilege level the caller should not obtain.
  4. Component remounting. As a sys-privileged user, attempt to influence the Application Manager into unmounting a core component and mounting a replacement, then trigger a core dump; a positive result is execution of the replacement with full capabilities and root.
  5. Privilege dropping. Exercise the paths where azcore drops privileges and check whether capability restrictions can be bypassed; a positive result is an operation the capability model should forbid.
  6. Cross-environment capability files. Try claiming a device on a pre-production or staging server and using the resulting capability file against production; a positive result is re-enabling development mode on a finalised device, including one claimed by someone else. Remember that deploying the file requires physical access.

Glossary

  • Azure Sphere: a hardened IoT device made by Microsoft, with a secure link to the cloud, running a hardened Linux operating system on an ARM processor.
  • IoT (internet of things): everyday objects that are connected to the internet, such as sensors, meters and appliances.
  • Bug bounty programme: a scheme where a company pays people for finding and reporting security flaws so they can be fixed.
  • Azure Sphere Research Challenge: Microsoft's bug bounty programme for Azure Sphere, started in late May 2020, with extra scenarios and increased payouts.
  • Hardened: built with many layers of protection from the start.
  • ARM processor: a processor design common in phones and small devices.
  • Secure core: a separate, protected part of the chip meant to keep working safely even if the main part is compromised.
  • Application package: a bundle of files installed on the device, mounted so its contents appear at a particular place in the file system.
  • Mount point: the folder where a package's contents are made available.
  • Application Manager: the part of the system that installs, starts, stops and removes applications.
  • azcore: a core component of the Azure Sphere software that runs with high privileges.
  • Linux Security Module (LSM): a part of Linux that enforces extra rules about what programs may do, on top of normal user permissions.
  • Device claiming: registering a device to an owner so only that owner can manage it.
  • Certificate: a digital document that proves identity, like a passport for a computer.
  • Symlink (symbolic link): a shortcut file that points to another file or folder.
  • Security feature bypass: getting around a protection that is supposed to stop you.
  • Character device: a special file that represents a piece of hardware, such as a disk or serial port.
  • Flash memory: the storage chip that holds the device's software.
  • Remote code execution (RCE): making a device run an attacker's code, often from a distance.
  • uid_map file: a Linux configuration file that translates user identifiers between contexts, such as inside and outside a container.
  • Container: an isolated mini-system inside a computer.
  • Elevation of privilege (EoP): gaining rights you were not meant to have.
  • sys user: a privileged account on Azure Sphere, below root.
  • Root: the most powerful account on a Linux system.
  • Unmounting: detaching a component so its files are no longer available at their usual place.
  • Rogue binary: a malicious program.
  • Core dump: a file the system writes when a program crashes, to help debugging.
  • Capabilities: fine-grained permissions, such as "may use the network" or "may write to this file".
  • Privilege dropping: a program giving up some of its rights before doing risky work.
  • Capability file: a digital permission slip used on Azure Sphere.
  • Development mode: a state that lets developers load their own applications onto a device.
  • Finalised device: a device that has been locked down for normal use.
  • Chain exploit: using several smaller weaknesses one after another to reach a bigger goal.
  • Remote attestation: a way for a device to prove to a remote service that it is running the software it is supposed to be running.
  • Pre-production server: a test version of a service, used before the real one.
  • Production environment: the real service that ordinary customers use.

More from Microsoft

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.