Shoot For The Galaxies: Our Samsung S25 1-click RCE Journey
Yichen Chai (Vulnerability Researcher · Bugscale), Sacha Kozma (Security Researcher · Bugscale)
Insomni'hack 2026 · Day 1 · Main Track
Overview
This technical presentation details the discovery and exploitation of a 1-click remote code execution (RCE) chain targeting the Samsung Galaxy S25. Delivered by vulnerability researchers Yichen Chai and Sacha Kozma from Bugscale, the talk chronicles a high-stakes research sprint originally initiated for Pwn2Own 2025. Although the team missed the registration deadline due to time constraints, their persistent post-deadline analysis uncovered severe architectural flaws in Samsung Smart Switch, the pre-installed data migration application present on hundreds of millions of Galaxy devices.

Key moments
- 0:00 Introduction and attack surface identification
- 6:00 Analyzing Samsung Smart Switch and deep links
- 12:00 Protocol analysis of TCP and file write commands
- 17:30 Setting up LAN transfer interception and forwarding
- 22:00 Rooting the phone and finding the core installation bug
- 27:30 Bypassing authentication and cracking the pin key
- 36:00 Refining the exploit to skip encryption and authentication
- 40:30 Live demo, reward details, and Q&A session
Shoot For The Galaxies: Our Samsung S25 1-click RCE Journey
Speakers: Yichen Chai (Vulnerability Researcher, Bugscale); Sacha Kozma (Security Researcher, Bugscale)
Conference: Insomni'hack
YouTube: https://www.youtube.com/watch?v=QBYnKX9YPOE
Overview
This technical presentation details the discovery and exploitation of a 1-click remote code execution (RCE) chain targeting the Samsung Galaxy S25. Delivered by vulnerability researchers Yichen Chai and Sacha Kozma from Bugscale, the talk chronicles a high-stakes research sprint originally initiated for Pwn2Own 2025. Although the team missed the registration deadline due to time constraints, their persistent post-deadline analysis uncovered severe architectural flaws in Samsung Smart Switch, the pre-installed data migration application present on hundreds of millions of Galaxy devices.
The significance of this research lies not only in the severity of the resulting vulnerability chain—which allows arbitrary application installation and execution without user interaction via local area network (LAN) or Wi-Fi Direct vectors—but also in Samsung's industry response. Samsung awarded the researchers a $100,000 USD payout, marking the first time external researchers successfully qualified for Samsung's ISVP (Important Scenario Vulnerability Program) with a full exploitation chain. This article explores the reconnaissance, protocol reverse engineering, state-machine manipulation, and ultimate exploitation primitives that enabled the 1-click RCE.
Background
▶ Watch: Introduction and attack surface identification (0:00)
When setting out to find an entry vector for Pwn2Own 2025 targeting Samsung mobile hardware, the researchers evaluated several potential attack surfaces. Radio protocols such as Wi-Fi, Bluetooth, and cellular baseband stacks presented formidable barriers, requiring complex memory corruption exploits and substantial fuzzing infrastructure—a domain traditionally dominated by elite groups like Google Project Zero. Consequently, the team pivoted to the browser vector, treating the Samsung Internet Browser as a launching pad to interact with pre-installed applications via deep links.
A fresh Samsung Galaxy S25 contains roughly 300 to 355 pre-installed system applications. Many of these apps expose exported components that accept deep link parameters, allowing an attacker to transition from browser context into privileged application contexts. While previous Pwn2Own entries successfully chained multiple deep links to achieve installation primitives, the researchers sought a more direct and reliable component. They focused their efforts on pre-installed applications possessing native package installation capabilities—specifically, applications capable of silently installing packages without prompting the user.
After auditing a subset of candidates, the researchers identified Samsung Smart Switch as a high-value target. Smart Switch is Samsung's official data migration utility designed to transfer contacts, photos, media, and applications from a legacy device to a new Galaxy phone. Despite its massive attack surface and deep system privileges, public security research on Smart Switch was sparse, aside from an NCC Group finding at Pwn2Own 2024 targeting a sub-component (Smart Switch Agent) for arbitrary APK installation via missing sanity checks.
Key Findings
▶ Watch: Protocol analysis of TCP and file write commands (12:00)
The investigation into Samsung Smart Switch yielded several critical security findings regarding authentication bypasses, state machine deficiencies, and insecure protocol design:
- Unauthenticated Protocol Commands: Once a peer connects to a Smart Switch instance over Wi-Fi Direct or LAN, the underlying TCP command handler processes administrative and operational commands blindly without enforcing active session tokens or robust authentication checks.
- Flawed HMAC Validation: The application's authentication mechanism verified handshake HMAC values using Java's
startsWith()string prefix method instead of a secure equality comparison (equals()). This flaw allowed an attacker to bypass authentication entirely by supplying a 1-byte HMAC prefix. - State Machine Blind Trust: After a connection is established, the application initializes a series of expected data transfer job items. Replaying or forcing transfer requests for unselected items (such as pending SMS or calendar sync jobs) forces the package installation pipeline to execute prematurely, bypassing user confirmation prompts.
- Encryption Downgrade Primitives: The binary protocol header includes an explicit flag designating whether a network packet is encrypted. Setting this flag to unencrypted bypasses payload decryption requirements on the receiver side.
- PIN vs. QR Code Key Truncation: When operating in PIN pairing mode rather than QR code mode, the shared cryptographic key is truncated to its final three bytes to accommodate manual user input. This small keyspace can be brute-forced offline in under 10 seconds.
Technical Deep Dive
▶ Watch: Rooting the phone and finding the core installation bug (22:00)
The Smart Switch communication architecture operates over two primary transport layers: Wi-Fi Direct for proximity-based device-to-device transfers and standard local area network (LAN) sockets using UDP broadcast discovery and TCP data channels.
When launched via deep link (SmartSwitch://launch?d2d_con=...), the application can be forced into receiver mode. The protocol framing consists of a 4-byte big-endian length header followed by command structures, IPv4 addresses, and operational flags. Offset 34 of the protocol header contains an encryption-enabled flag that dictates whether the TCP payload requires decryption.
Initially, authentication requires a cryptographic handshake where both parties exchange a nonce and compute an HMAC using a shared secret derived from a QR code or 10-character PIN. The receiver verifies the sender's HMAC using the following vulnerable validation logic:
Because startsWith() is utilized, sending a 1-byte base64-encoded HMAC string (which possesses only 64 possible ASCII/Base64 character variations) successfully satisfies the conditional check if it matches the first character of the expected HMAC.
Furthermore, the data transfer logic on the receiver side manages 36 distinct job items (contacts, messages, apps, etc.). During normal operation, the user selects specific items to transfer. However, the researchers discovered via Frida instrumentation that the handler method g6.x.handleMessage() processes incoming transfer chunks without cross-referencing them against the user's active UI selections. By injecting transfer commands for unselected or pending job queues via a custom Python script, the package installer API (packageinstaller.openSession) is triggered automatically, silently installing an arbitrary APK.
Demo / Proof of Concept
▶ Watch: Bypassing authentication and cracking the pin key (27:30)
The researchers demonstrated the attack flow using a Python-based exploit script targeting a Samsung Galaxy S25 connected to the same local network.
- The target device is induced to open the Smart Switch receiver interface via a browser deep link (or via an auxiliary Galaxy Store webview XSS vulnerability used to cycle states if brute-forcing is required).
- The Python exploit script connects to the target's listening TCP port (defaulting to socket operations established via LAN discovery UDP port
8400). - The script bypasses the cryptographic handshake by either omitting authentication headers or exploiting the 1-byte HMAC prefix condition.
- The exploit script sets the protocol header encryption flag to unencrypted (
0x00), eliminating the need to decrypt payload traffic or brute-force the truncated 3-byte PIN key space. - The script replays transfer job items, causing the Smart Switch application on the Galaxy S25 to invoke the system package installer session without user interaction.
- The target device silently installs the designated payload APK (such as an Insomni'hack application package) and executes code.
In the live presentation demo, minor local network interface routing discrepancies initially interrupted the live execution, but the researchers successfully verified the mechanics using pre-recorded operational video footage demonstrating the silent installation progress bar concluding with the payload app appearing in the application drawer.
Defensive Implications
▶ Watch: Live demo, reward details, and Q&A session (40:30)
Defenders and security engineers managing Android enterprise deployments or analyzing OEM pre-installed software should extract several key lessons from this research:
- Strict Cryptographic Comparison: Never use string prefix methods (
startsWith()) or non-constant-time comparators for validating security tokens, cryptographic signatures, or HMACs. Always utilize cryptographic constant-time comparison functions to prevent oracle and prefix truncation attacks. - State Machine Integrity: Companion applications and migration utilities must maintain strict state validation. Allowing unselected or out-of-sequence migration job items to trigger privileged system APIs like
packageinstallerintroduces severe escalation vectors. - Transport Layer Security Enforcement: Protocol architectures should reject cleartext fallback flags. Allowing network protocol headers to dynamically disable encryption (
encryption_on = false) turns encrypted channels into trivial inspection and tampering targets. - Attack Surface Reduction for OEM Apps: Pre-installed system applications (bloatware/crapware) often retain massive privileged capabilities while undergoing significantly less security auditing than core operating system components. Organizations should audit and disable unused migration utilities (
SmartSwitch) on high-value enterprise devices.
Key Takeaways
- Massive Target Impact: Samsung Smart Switch is pre-installed on hundreds of millions of Galaxy devices, representing a massive, highly privileged attack surface for local and proximity-based exploitation.
- Flawed Handshake Validation: The application's reliance on
startsWith()for HMAC verification allowed complete authentication bypass using a 1-byte base64 input. - Blind Trust State Execution: Once connected, the application blindly trusted incoming TCP transfer commands, ignoring user-selected UI states and executing silent package installations.
- Encryption Downgrade: Explicit protocol header flags permitted attackers to disable encryption entirely, removing the requirement to reverse-engineer or brute-force PIN-derived session keys.
- Historical ISVP Recognition: This research submission successfully secured a $100,000 USD bug bounty, making Chai and Kozma the first external researchers to qualify for Samsung's Important Scenario Vulnerability Program (ISVP) with an end-to-end RCE chain.
About the Speaker(s)
- Yichen Chai (Vulnerability Researcher, Bugscale): Yichen Chai is a vulnerability researcher with a strong interest in memory corruption bugs who has recently moved into Android security research.
- Sacha Kozma (Security Researcher, Bugscale): Sacha Kozma specializes in reverse engineering, vulnerability research, and exploit development. He holds a Master's degree in Computer Science with a specialization in cybersecurity from EPFL.