Skip to content
Access control Advisory Advanced

Microsoft Azure Sphere Normal World application PACKET_MMAP unsigned code execution vulnerability

A vulnerability in Microsoft Azure Sphere's normal world allows a process with CAP_NET_RAW to create an executable memory mapping via PACKET_MMAP, which the kernel fills with attacker-controlled network data. An attacker could then execute arbitrary shellcode in the context of a compromised app.

Claudio Bozzato Follow

Originally disclosed on Cisco Talos

Medium 5.5 View original

A code execution vulnerability exists in the normal world’s signed code execution functionality of Microsoft Azure Sphere 20.07. A specially crafted AFPACKET socket can cause a process to create an executable memory mapping with controllable content.

Claudio Bozzato, Lilith >_> and Dave McDaniel, 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 kernel's PACKET_MMAP feature allows a process to map a buffer as executable while the kernel writes network data into it, bypassing the platform's W^X memory protection.

Impact

An attacker who has already compromised an app with CAP_NET_RAW could execute arbitrary unsigned code, potentially escalating privileges or bypassing platform security.

What the attacker needed

Compromised app with CAP_NET_RAW; ability to send network packets to the device

How it was found

  1. Create an AF_PACKET socket.
  2. Use setsockopt with PACKET_RX_RING to allocate a ring buffer.
  3. Map the buffer with PROT_READ|PROT_EXEC using mmap.
  4. Bind the socket to receive packets.
  5. Send shellcode to the device over the network.
  6. Locate the shellcode in the mapped buffer and jump to it.

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. Normally, it prevents memory from being both writable and executable, which stops attackers from running their own code. This report shows a way around that rule using a network feature, so an attacker who already controls a program could run unauthorised 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

1 more disclosed report, 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.