Carbonara The MediaTek exploit nobody served#1839
Open
carlospolop wants to merge 1 commit intomasterfrom
Open
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://shomy.is-a.dev/blog/article/serving-carbonara Content Categories: Based on the analysis, this content was categorized under "Hardware/Physical Access -> Firmware Analysis (or create a new page under Firmware Analysis / Mobile bootchain: "MediaTek XFlash/Download Agent (DA) exploitation - Carbonara two-BOOT_TO hash bypass + arbitrary write")". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
Overview
The post documents the (re)discovery and replication of a MediaTek exploit/technique the author calls Carbonara, observed in a paid GSM tool and reproduced as a working patch against mtkclient. The core abuse occurs during MediaTek’s XFlash protocol flow where DA1 (Download Agent stage 1) loads and verifies DA2 (stage 2) into DRAM before transferring execution. Car...
🔧 Technical Details
XFlash “two BOOT_TO” integrity-bypass trick (DA1→DA2 hash expectation overwrite): When a first-stage loader (DA1) enforces DA2 integrity by hashing the received DA2 and comparing it to an expected SHA-256 embedded in DA1, an attacker can still run a modified DA2 if they can patch DA1’s in-memory “expected hash” value. The practical pattern is: (1) issue
BOOT_TOonce to enter the DA1-driven staging flow, (2) send a crafted payload that locates the DA2-hash storage in DA1 memory and overwrites it with the SHA-256 of the attacker’s patched DA2, then (3) issueBOOT_TOagain / provide the new hash so DA1 validates the patched DA2 against the patched expected hash and jumps into it.Unchecked memory-write primitive via user-controlled DA2 load address/size on unpatched loaders: If the protocol allows the host to choose DA2’s load address and size without validation, the DA staging mechanism becomes an arbitrary memory write...
🤖 Agent Actions
Summary:
Testing:
This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.