Skip to content

DEF CON 34 talks are here: 354 talks, summarized and searchable.

Browse DEF CON 34

Environmental Disaster: A LaunchServices Tale

Ron Waisberg

Red TeamTalks25 minExpertOpen on YouTube ↗

Where

Talks
Objective by the Sea v4.0

Duration

25 min

Shows how a LaunchServices logic flaw let a sandboxed macOS app escape the App Sandbox in several ways.

Summary

The talk opens with a refresher on the macOS App Sandbox, which is meant to contain apps installed from the Mac App Store and limit damage from compromised apps. It explains why the ability to start other applications through Launch Services is a notable gap, since launched apps do not inherit the sandbox. The speaker traces how an open request moves from the framework to the Core Services UI agent and then to the process-launching daemons.

The core problem is that a sandboxed app can set environment variables on an unsandboxed application it launches. The speaker shows several ways this was abused: injecting a dynamic library into a scripting host, redirecting the home directory so a plugin loader reads from a path inside a sandbox container, and using a deprecated API to launch a Perl interpreter whose debug mode runs attacker-supplied code. An Electron app was also targeted through Node options. Each vector was addressed by a separate patch across several macOS releases, and the speaker argues the underlying design issue remains.

For defenders, the talk offers detection heuristics. These include flagging unsandboxed processes whose home variable points into another app's sandbox container, watching Electron apps launched with run-as-node settings, and treating a sandboxed parent that launches an unsandboxed child through Launch Services as suspicious. Developers are advised to avoid naming apps in ways that match Electron's own binary and to disable the run-as-node fuse. The speaker also released a tool for reversing recent macOS private frameworks.

Related talks

Talks·50 min

  • Objective by the Sea
  • Red Team
  • Date: Oct 2021
  • Location: Spain

Cedric Owens · Jaron Bradley · Patrick Wardle

Explains how a logic flaw in macOS policy code let unsigned apps bypass Gatekeeper, and how it was exploited as a zero-day.

vulnerability-researchreverse-engineeringmalware-analysis+2