Verified, then swapped: two supply-chain attacks on the code you didn’t write
A flaw in APT allowed a man-in-the-middle attacker to replace a package after its signature check, leading to code execution as root. Separately, a compromised third-party analytics script served mobile exploit chains to visitors of thousands of websites.
Published on medium.com
In the morning, Debian, Ubuntu and the developers of APT, the program that installs software on both systems, published fixes for a flaw that let an attacker on the network swap a package after it had passed its signature check. The attacker’s code then ran as root.
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 write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely improper handling of file resumption during retries, allowing a downloaded package to be replaced after verification.
Impact
An attacker on the network could replace a package after verification and run code as root; the analytics compromise served exploits to visitors, but only to outdated devices.
What the attacker needed
Attacker can alter HTTP traffic; APT retries enabled (default since 2.3.2); victim visits a site loading the compromised script; victim runs an outdated OS
The fix
The APT flaw was fixed in updated versions; for the analytics issue, use Subresource Integrity and Content-Security-Policy to limit third-party script execution.
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 write-up has not been written yet. The Original tab links to the source.
APT is the tool that installs software on Debian and Ubuntu Linux. It checks a package's signature to make sure it is genuine, but a bug let an attacker swap the file after that check, so malicious code ran with full control. In the second story, a popular analytics script was altered to deliver phone exploits to visitors of many websites.
What is RCE?
Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.