Skip to content
Access control Advisory Advanced CVE-2021-27074

Microsoft Azure Sphere Linux namespace ptrace unsigned code execution vulnerability

An unsigned code execution vulnerability exists in Microsoft Azure Sphere 21.01 due to improper access control in the Linux namespace ptrace functionality. An attacker could create a new user namespace, use ptrace to modify the code of a running process, and execute unsigned code.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

Medium 6.2 View original

An unsigned code execution vulnerability exists in the Linux namespace ptrace functionality of Microsoft Azure Sphere 21.01. Specially crafted shellcode could allow an adversary to execute unsigned code.

Claudio Bozzato and Lilith >_>, on Cisco Talos

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.

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 ptrace access check only verifies that the tracing process has CAP_SYS_PTRACE in the tracee's user namespace, without ensuring that the namespace is not the initial root namespace, allowing an unprivileged user to create a new user namespace and obtain that capability.

Impact

An attacker could execute unsigned code on the device, potentially compromising its security guarantees.

What the attacker needed

Local access to the device; ability to run code on the device

How it was found

  1. Create a new user namespace using unshare or clone.
  2. Fork or clone a child process within the new namespace.
  3. Attach to the child process using PTRACE_ATTACH.
  4. Modify the child's executable memory using PTRACE_POKETEXT.
  5. Let the child resume, executing the modified code.

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.

Azure Sphere is a secure platform for Internet of Things devices that normally only runs code signed by Microsoft. This report shows that an attacker with local access could bypass that restriction by using a Linux feature called namespaces to gain special tracing permissions, then use those permissions to alter a running program and run their own unsigned code.

What is Access control?

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.

More by Claudio Bozzato

View all

13 more disclosed reports, best first.

More from Cisco Talos

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.