"Well well well, if it isn’t the consequences of my own actions" - the time I got in the middle of 100,000 Linux machines and their fwupd/LVFS firmware updates 🙈

Justin Steven (Head of Research · Tanto Security)

BSides Canberra VIII (2025) · Day 2 · Main Track

Overview

In this compelling talk from BSides Canberra, Justin Steven, Head of Research at Tanto Security, recounts a fascinating journey into the murky waters of firmware update mechanisms, supply chain vulnerabilities, and the subtle complexities of cryptographic APIs. Titled "Well well well, if it isn’t the consequences of my own actions," Steven details how a personal quest to update his laptop's firmware inadvertently led him to control an S3 bucket used by an estimated 100,000 Linux machines and uncover a critical signature bypass vulnerability in the fwupd (firmware updater) client.

Watch on YouTube

Visual summary for "Well well well, if it isn’t the consequences of my own actions" - the time I got in the middle of 100,000 Linux machines and their fwupd/LVFS firmware updates 🙈 by Justin Steven
Visual summary for "Well well well, if it isn’t the consequences of my own actions" - the time I got in the middle of 100,000 Linux machines and their fwupd/LVFS firmware updates 🙈 by Justin Steven

Key moments

  1. 0:00 Introduction and Firmware Update Quest
  2. 3:00 Discovery of Non-Existent S3 Firmware Bucket
  3. 9:45 100,000 Linux Hosts Phoning Home
  4. 19:00 Signature Bypass: Attached vs. Detached PGP
  5. 27:30 Root Cause: GPGME Zero Signatures Return
  6. 38:00 Making Your Own Luck in Research
  7. 51:00 Q&A: Hypothetical Malicious Firmware Attack

"Well well well, if it isn’t the consequences of my own actions" - the time I got in the middle of 100,000 Linux machines and their fwupd/LVFS firmware updates 🙈

Speakers: Justin Steven (Head of Research, Tanto Security)

Conference: BSides Canberra

YouTube: https://www.youtube.com/watch?v=boT88qkWFTY

Overview

In this compelling talk from BSides Canberra, Justin Steven, Head of Research at Tanto Security, recounts a fascinating journey into the murky waters of firmware update mechanisms, supply chain vulnerabilities, and the subtle complexities of cryptographic APIs. Titled "Well well well, if it isn’t the consequences of my own actions," Steven details how a personal quest to update his laptop's firmware inadvertently led him to control an S3 bucket used by an estimated 100,000 Linux machines and uncover a critical signature bypass vulnerability in the fwupd (firmware updater) client.

The talk serves as a stark reminder of the often-overlooked risks associated with cloud resource management and the deep technical intricacies required for robust software security. Steven's narrative highlights how an outdated software configuration, combined with a seemingly innocuous deletion of a cloud storage bucket, created a perfect storm for a widespread supply chain attack vector. His detailed root cause analysis of the signature bypass within fwupd exposes a fundamental misunderstanding of cryptographic library behavior, offering invaluable lessons for developers building secure systems.

Ultimately, Steven's story is a testament to the power of curiosity and "computing weird" – how deviating from conventional user patterns can expose critical flaws hidden beneath the surface of widely used software. It underscores the importance of thorough security auditing, especially for components that manage system integrity like firmware updates, and provides actionable insights for both defenders and developers in navigating the complex landscape of modern software supply chains.

Background

▶ Watch: Introduction and Firmware Update Quest (0:00)

Justin Steven’s journey began in late 2019, driven by a desire to update his laptop's firmware to address a Thunderbolt or UEFI bug. His machine, a Debian oldstable Linux system, was configured somewhat unconventionally. As a self-proclaimed "insufferable person," he uses the i3 tiling window manager and performs most tasks from the terminal, eschewing traditional desktop environments and even file managers. This idiosyncratic approach proved pivotal in his discovery.

He sought out the Linux Vendor Firmware Service (LVFS), a cloud-based platform where hardware vendors upload firmware blobs for various devices (wireless mice, docking stations, etc.). To interact with LVFS, users employ the fwupd (firmware updater) client. This client operates on a client-server model: a root-privileged fwupd daemon handles flashing operations, while a user-level utility, fwupd-manager, communicates with the daemon via D-Bus to request updates.

Steven initiated a fwupd-manager refresh command to pull the catalog of available updates. To his surprise, he received an error: "failed to download a file from S3" because "the bucket could not be found." This immediately raised a red flag. The reason for this error stemmed from Debian's release model. Debian's "stable" releases are snapshots in time, receiving only critical bug and security fixes, but no new features or major version increments. Steven was running Debian 9, which had frozen fwupd at version 0.7.4 (released in 2016).

About a year later, fwupd version 1.0.6 was released, introducing a crucial configuration change. This new version updated the default URL for firmware updates, pointing it to an interstitial hostname controlled by LVFS. This design allowed LVFS to pivot their backend storage (e.g., switch CDNs) without requiring client updates. Older fwupd versions, like Steven's 0.7.4, continued to point directly to the original S3 bucket.

As planned, LVFS eventually changed its CDNs and, in November 2019, deleted the old S3 bucket. They assumed all active users would be on fwupd versions that used the interstitial hostname, rendering the old bucket obsolete. However, this assumption overlooked users like Steven, running older but still supported Debian releases, whose fwupd clients continued to try and access the now non-existent bucket.

Key Findings

▶ Watch: 100,000 Linux Hosts Phoning Home (9:45)

Steven's investigation into the non-existent S3 bucket led to two critical discoveries: a widespread S3 bucket takeover vulnerability and a subtle but severe cryptographic signature bypass in the fwupd client itself.

  1. S3 Bucket Takeover and Scale: Recognizing that S3 bucket names are globally unique and can be re-registered once deleted, Steven pondered the ethical implications of claiming the defunct LVFS bucket. After some deliberation, he registered the bucket name himself, becoming the "proud owner of LVFS bucket." He enabled logging and went to bed, expecting minimal traffic. To his astonishment, he woke up to 41,000 requests overnight. This was orders of magnitude more than anticipated. He realized that unlike his terminal-centric workflow, most users interacted with fwupd via graphical frontends like Gnome Software, KDE's equivalent, or Canonical's and System76's tools, which automatically check for updates every 24 hours. His conservative estimate placed the number of unique hosts phoning home to his bucket at around 100,000 daily, indicating a massive potential impact.
  1. Cryptographic Signature Bypass Vulnerability: While controlling the bucket, Steven couldn't simply serve malicious firmware because LVFS employs a strong chain of integrity: a PGP detached signature signs an XML manifest, which in turn contains cryptographic hashes (e.g., SHA family) of the actual firmware files. Without the private key, he couldn't forge a valid signature for a modified XML file. However, through systematic "manual fuzzing" of fwupd's signature validation, he discovered a critical flaw. By providing an attached PGP signature (a single file containing both the signed data and the signature) instead of the expected detached signature (two separate files: data and signature), fwupd's validation logic was completely bypassed. This allowed him to serve an arbitrary, unsigned XML manifest, effectively enabling him to advertise any firmware update to the 100,000 affected Linux hosts. This vulnerability, present even in later fwupd versions, meant an attacker with control of the S3 bucket could trick users into installing malicious firmware.

These findings revealed a significant supply chain risk: a combination of poor cloud asset management (deleting a still-referenced S3 bucket) and a subtle cryptographic implementation flaw could lead to arbitrary code execution via firmware updates on a vast number of Linux systems.

Technical Deep Dive

▶ Watch: Signature Bypass: Attached vs. Detached PGP (19:00)

The core of the technical vulnerability lies within fwupd's handling of PGP signatures and its interaction with the GPGME (GNU Privacy Guard Made Easy) library.

The LVFS data model relies on two primary files in the S3 bucket:

  1. A gzipped XML file: This serves as the manifest, cataloging available firmware updates. For each update, it specifies a URL to the actual firmware binary and a cryptographic hash (e.g., SHA family) of that firmware file.
  2. A PGP detached signature: This file cryptographically signs the XML manifest.

The intended chain of integrity is robust:

  • The fwupd client downloads both the XML manifest and its detached PGP signature.
  • It verifies the PGP signature against the XML file using a trusted public key.
  • If the signature is valid, it then downloads the firmware binary specified in the XML.
  • Finally, it verifies the cryptographic hash of the downloaded firmware against the hash listed in the XML manifest.

The critical assumption was that successfully verifying the PGP signature on the manifest would ensure its authenticity. Steven's bypass targeted this first step.

The Signature Bypass Mechanism

Steven's "weird case" involved replacing the expected detached signature file with an attached signature file. PGP supports both types:

  • Detached signature: A separate file containing only the signature, requiring the original data file for verification. This is what LVFS used.
  • Attached signature (or "normal signature"): A single file containing both the original data and its signature, often larger as it encapsulates the data.

Steven crafted an arbitrary attached signature (e.g., signing the word "LOL" with his own untrusted PGP key) and served it in place of the legitimate detached signature. He then served his own malicious XML manifest.

The fwupd signature validation code, circa early 2020, involved three conceptual steps:

  1. Mathematical cryptographic validation: A call to gpgme_op_verify_ext() from the GPGME library, taking the signature file and the data (XML file) as input. This function performs the core cryptographic checks.
  2. Extraction of results: If step 1 succeeds, fwupd extracts the results of this validation into a structure.
  3. Analysis of results: fwupd then iterates over a linked list of signatures within the extracted result structure. Its logic was to "bail out if any of them are bad." If the loop completed without finding any bad signatures, the signature was considered "good."

Steven debugged the execution flow with his "weird case":

  • gpgme_op_verify_ext() call: fwupd calls this function with the attached signature as the sig parameter and the XML data as the signed_text parameter. Crucially, the plain parameter is NULL. The GPGME documentation describes two primary ways to call this function:
  • If sig is a detached signature: signed_text should be the data, plain should be NULL. (This is the intended LVFS usage).
  • If sig is a normal (attached) signature: signed_text should be NULL, and plain should be a writable data object to extract the original data from the attached signature.

Steven's call pattern (sig = attached, signed_text = data, plain = NULL) did not match either documented usage. Despite this, the gpgme_op_verify_ext() function succeeded without error.

  • Extraction and Analysis: Since the initial cryptographic validation succeeded, fwupd proceeded to extract the results. In the "weird case" (attached signature provided where detached was expected, with a NULL plain parameter), the extracted result structure's signatures field was null (an empty list).
  • The Flaw in fwupd's Logic: Because the signatures list was empty, the loop designed to "bail out if any of them are bad" never executed. With no signatures to check, no "bad" signatures were found. Consequently, fwupd concluded, "looks good to me."

The root cause was a combination of fwupd's flawed assumption (that if gpgme_op_verify_ext() succeeds, there would always be at least one signature to check) and the GPGME library's unexpected behavior (returning success with zero signatures when called in a non-standard way). fwupd was checking for the absence of bad signatures rather than the presence of at least one good, trusted signature. This allowed an attacker controlling the update source to completely bypass the cryptographic integrity checks.

Demo / Proof of Concept

▶ Watch: Making Your Own Luck in Research (38:00)

While Justin Steven did not deploy actual malicious firmware to the 100,000 affected machines, he developed a robust proof-of-concept (PoC) in a controlled lab environment.

To demonstrate the signature bypass, he configured his fwupd client to point to his own web server instead of the legitimate LVFS endpoint. This allowed him to control the content served to his client, simulating the S3 bucket takeover.

His web server was designed to:

  1. Serve an arbitrary, attacker-controlled XML manifest.
  2. Serve an attached PGP signature (e.g., signing the word "LOL" with his personal, untrusted PGP key) in place of the expected detached signature for the XML manifest.

When he initiated an update check using Gnome Software (a common graphical frontend for fwupd), the bypass successfully allowed his custom XML to be processed. He visually confirmed that Gnome Software advertised what appeared to be a malicious firmware update. The interface showed a prompt for a device update, indicating that the signature check had been bypassed and his arbitrary manifest was accepted as legitimate.

Steven did not proceed to click the "install" button, stating, "I didn't click the install button cuz I was scared my device couldn't be used after the update either." However, the ability to successfully advertise a crafted firmware update, complete with arbitrary device names and descriptions, was sufficient to prove the severity of the vulnerability. It demonstrated that an attacker could trick a user into flashing compromised firmware onto their hardware. He acknowledged that he lacked the specialized skills to write actual malicious firmware for specific hardware, but the critical part – bypassing the integrity check – was definitively achieved.

Defensive Implications

▶ Watch: Q&A: Hypothetical Malicious Firmware Attack (51:00)

The findings from this research have several crucial implications for software defenders, developers, and organizations managing cloud infrastructure:

  1. S3 Bucket Lifecycle Management: The initial vector for this attack was the deletion of an S3 bucket (LVFS bucket) that was still referenced by a significant number of older, but active, clients.
  • Recommendation: Organizations must implement robust lifecycle management for cloud storage. Before deleting any public-facing resource, thoroughly audit its references, including those from older client versions. Consider sinkholing bucket names (making them permanently unavailable) or deprecating them gracefully by serving a 404 with a specific, un-takeover-able error, rather than outright deletion if there's any chance of lingering references. LVFS, upon disclosure, re-registered the bucket and committed to not deleting it again.
  1. Cryptographic API Usage: The fwupd signature bypass stemmed from a subtle misuse or misunderstanding of the GPGME library's gpgme_op_verify_ext() function.
  • Recommendation for Developers:
  • Understand API Edge Cases: Cryptographic APIs are notoriously complex. Developers must deeply understand their documentation, including all parameters, return values, and documented (and undocumented) edge cases. Testing with unexpected inputs (like an attached signature where a detached is expected) is crucial.
  • Validate Positive Conditions: Instead of merely checking for the absence of bad signatures ("zero bad means good"), explicitly check for the presence of at least one good and trusted signature. This "positive validation" principle is a fundamental security best practice.
  • Handle Zero Results Explicitly: If a cryptographic validation function can legitimately return zero results (e.g., zero signatures), the application must explicitly handle this case as an error or an invalid state, not as a successful validation. The fwupd tactical fix was to bail out if zero signatures were returned.
  • Safe APIs: Advocate for cryptographic libraries to provide "safe APIs" that are difficult to use incorrectly, minimizing the chances of developers misinterpreting their behavior.
  1. Software Update Supply Chain Security:
  • End-to-End Integrity: While LVFS provides integrity for the manifest, the ultimate security often depends on the hardware itself. Hardware vendors (e.g., ASUS) should implement their own end-to-end integrity checks, ensuring that firmware flashed to their devices is signed by their specific keys, independent of the transport mechanism. Attackers would then need to bypass this additional hardware-level check.
  • Layered Security: Relying solely on a single layer of cryptographic validation (like fwupd checking the LVFS manifest) is insufficient. Multiple layers of validation, from transport to device-specific checks, enhance resilience.
  1. The Importance of Staying Updated: Steven's initial exposure was due to running Debian oldstable, which maintained an older, vulnerable version of fwupd.
  • Recommendation for Users/Admins: Keep software updated. While Debian's "stable" model prioritizes compatibility, it can mean being stuck on versions vulnerable to infrastructure changes or subtle bugs later discovered. Understand the trade-offs of your chosen software distribution's update policies.
  1. Debian's Deviations from Upstream: Steven noted that a patch rejected by GNU PG upstream (for hardening that broke his trick) was later picked up by FreePG and then integrated into Debian's packaging of GNU PG.
  • Implication: While this specific patch improved security against Steven's trick, deviations from upstream can introduce new compatibility issues or unintended side effects, as seen with the 2008 OpenSSL incident on Debian. Organizations relying on specific distributions should be aware of such deviations and their potential impact.
  1. "Luck Surface Area" and Observability: Steven's terminal-centric workflow exposed him to the S3 error message that GUI clients might have suppressed.
  • Recommendation: Encourage users and administrators to engage with systems at a deeper level. Pay attention to error messages, even seemingly minor ones. Better logging and error reporting in client software can increase the "luck surface area" for discovering critical issues.

Key Takeaways

  • S3 Bucket Deletion Risks: Deleting cloud resources like S3 buckets without thoroughly auditing all potential references, especially from older client versions, can create severe supply chain vulnerabilities through bucket takeover.
  • Cryptographic API Misuse is Critical: Subtle misunderstandings or misapplications of cryptographic library functions, particularly regarding parameter usage and return values, can lead to complete security bypasses.
  • "Zero Bad" Does Not Equal "Good": Software must explicitly validate positive security conditions (e.g., "at least one trusted signature found") rather than merely relying on the absence of negative conditions ("no bad signatures found").
  • Older Software in Stable Distributions: While "stable" distributions prioritize compatibility, they can inadvertently perpetuate vulnerabilities tied to infrastructure changes or subtle implementation bugs that are fixed in newer upstream versions.
  • "Computing Weird" Can Uncover Bugs: Deviating from common user patterns, such as performing updates from the terminal, can expose error messages and behaviors that might be hidden by graphical interfaces, leading to the discovery of critical vulnerabilities.
  • Supply Chain Security Requires Multiple Layers: Robust security for software updates demands end-to-end integrity, including strong transport security, manifest validation, and device-specific firmware signing, to withstand various attack vectors.

About the Speaker(s)

Justin Steven is the Head of Research at Tanto Security. He describes himself as someone who "likes to make computers weird," a philosophy that directly led to the discovery and detailed analysis presented in this talk. His work focuses on uncovering intricate vulnerabilities and understanding their root causes. He is also slated to give another talk with his colleague Mario, Technical Director and co-founder at Tanto Security, on a template injection bug, showcasing his team's ongoing contributions to security research.

Reviews

  • Dr. Zero (Offensive Security Researcher) — MUST SEE ★★★★★
  • Heather Calloway (CISO) — MUST SEE ★★★★★

→ Top-rated talks at BSides Canberra VIII (2025)

All talks from BSides Canberra VIII (2025)