Back to Blog
critical SEVERITY5 min read

Silent Code Injection: How Missing Signature Verification Defeats Checksum Security

A critical vulnerability in a Python build script allowed potential man-in-the-middle attackers to bypass SHA256 checksum verification by serving malicious checksums alongside compromised binaries. This fix implements proper cryptographic signature verification, ensuring that downloaded artifacts are genuinely from trusted sources—not just matching a potentially tampered checksum file.

O
By Orbis AppSec
•Technically reviewed by Anupam Mediratta•Published May 6, 2026•Reviewed June 3, 2026

Answer Summary

This is a checksum verification bypass vulnerability (CWE-347: Improper Verification of Cryptographic Signature) in a Python build script that allowed man-in-the-middle attackers to serve both malicious binaries and matching checksums, defeating SHA256 verification. The fix implements cryptographic signature verification to ensure artifacts are genuinely from trusted sources, not just matching an attacker-controlled checksum file. This prevents supply chain attacks where both the artifact and its checksum are compromised together.

Vulnerability at a Glance

cweCWE-347 (Improper Verification of Cryptographic Signature)
fixImplement GPG signature verification to authenticate artifact source before checksum validation
riskMan-in-the-middle attackers can inject malicious code by serving compromised binaries with matching checksums
languagePython
root causeSHA256 checksum verification without cryptographic signature validation
vulnerabilityChecksum verification bypass via MITM attack

Introduction

In the world of software development, we often trust that the tools and dependencies we download are exactly what they claim to be. But what happens when the very mechanism designed to verify integrity can itself be compromised?

Today, we're examining a critical vulnerability discovered in a CPython build script that highlights a common but dangerous misconception: SHA256 checksums alone do not guarantee authenticity. This vulnerability could have allowed attackers to inject malicious code into developer environments completely undetected.

If you're building software that downloads and verifies external resources, this post is essential reading.

The Vulnerability Explained

What Went Wrong?

The vulnerable code in plugins/python-build/scripts/add_cpython.py followed a seemingly reasonable security practice:

  1. Fetch the CPython binary from a URL derived from the GitHub API
  2. Download a corresponding SHA256 checksum file over HTTPS
  3. Verify the binary matches the checksum
  4. Proceed with installation

On the surface, this looks secure. HTTPS provides transport encryption, and SHA256 is a strong cryptographic hash. So what's the problem?

The Critical Flaw: No Signature Verification

The checksum file itself had no cryptographic signature verification (GPG/PGP). This means the script trusted any checksum file served from the expected URL without verifying it was actually created by the legitimate maintainers.

Think of it this way: you're verifying that a package matches a shipping label, but you never verified that the shipping label itself is authentic.

How Could This Be Exploited?

An attacker performing a man-in-the-middle (MITM) attack or DNS spoofing could:

  1. Intercept the checksum request and serve a malicious checksum file
  2. Intercept the binary download and serve a compromised CPython binary
  3. Ensure the malicious checksum matches the malicious binary

The result? The SHA256 verification passes with flying colors, and the developer unknowingly installs attacker-controlled code.

┌─────────────┐         ┌─────────────┐         ┌─────────────┐
│  Developer  │ ──────► │  Attacker   │ ──────► │   GitHub    │
│   Machine   │ ◄────── │   (MITM)    │ ◄────── │   Servers   │
└─────────────┘         └─────────────┘         └─────────────┘
                              │
                              ▼
                    ┌─────────────────┐
                    │ Serves matching │
                    │ malicious binary│
                    │ + fake checksum │
                    └─────────────────┘

Real-World Impact

This is a supply chain attack vector. The consequences could include:

  • Backdoored Python installations on developer machines
  • Compromised CI/CD pipelines building production software
  • Credential theft from development environments
  • Lateral movement into production systems

Supply chain attacks like SolarWinds and Codecov have shown us that compromising developer tools is one of the most effective ways to breach organizations at scale.

The Fix

What Changed?

The fix implements proper cryptographic signature verification for downloaded artifacts. Instead of trusting any checksum file served over HTTPS, the script now:

  1. Downloads the checksum file
  2. Downloads the corresponding GPG/PGP signature
  3. Verifies the signature against known, trusted public keys
  4. Only then proceeds with the SHA256 verification

The Security Improvement

This creates a chain of trust:

Trusted Public Key (pre-installed)
         │
         ▼
    Signature Verification ────► Proves checksum file is authentic
         │
         ▼
    SHA256 Verification ────► Proves binary matches authentic checksum
         │
         ▼
    Safe Installation

An attacker would now need to compromise the private signing keys of the legitimate maintainers—a significantly higher bar than intercepting network traffic.

Defense in Depth

This fix exemplifies the principle of defense in depth:

Layer Protection
HTTPS Encrypts transport (but can be intercepted)
SHA256 Verifies integrity (but not authenticity)
GPG Signature Verifies authenticity (requires private key)

Each layer addresses different threat vectors, and together they provide robust protection.

Conclusion

This vulnerability serves as a powerful reminder that security controls must be complete to be effective. A SHA256 checksum without signature verification is like a lock without a door—it looks secure but provides no real protection against determined attackers.

Key Takeaways

  1. Checksums verify integrity, not authenticity — You need both
  2. HTTPS is not enough — Transport security doesn't prevent all MITM scenarios
  3. Supply chain attacks are real — Your build scripts are attack surfaces
  4. Defense in depth matters — Layer your security controls

As developers, we must think like attackers when designing security controls. Ask yourself: "If I controlled the network between my code and the resource it's fetching, what could I do?" If the answer is "serve malicious content," you have work to do.

Stay secure, verify signatures, and never trust the network.


Want to learn more about supply chain security? Check out the SLSA framework and sigstore for modern approaches to software supply chain integrity.

Prevention and further reading

Related Articles

medium

path-to-regexp 0.1.12 DoS: Catastrophic Backtracking on Malformed URL

path-to-regexp version 0.1.12 contains a regular expression engine vulnerability where maliciously crafted URL parameters trigger exponential backtracking, causing CPU exhaustion and service unavailability. Upgrading to version 0.1.13 eliminates the vulnerable pattern from the parsing logic.

critical

CVE-2026-59873: node-tar 7.5.11 DoS via Crafted Gzip Bomb

node-tar versions 7.5.11 through 7.5.18 are vulnerable to a denial-of-service attack through maliciously crafted gzip archives that decompress to disproportionately large sizes. An attacker can exploit this to exhaust memory and CPU resources by submitting a small, highly compressed archive that expands beyond configured limits during extraction.

high

MapManager.get() Race Condition Duplicates API Requests

The MapManager's `get(mapUid, cache)` method used a check-then-act pattern that permitted multiple concurrent requests to pass the cache miss check simultaneously, triggering redundant API calls and risking cache corruption. The fix introduces a `_pending` promise map to deduplicate in-flight fetches for identical map UIDs.

critical

Lampa Desktop Auto-Update Heuristic Bypass: Execution of Unverified

Lampa Desktop's auto-update mechanism downloaded JavaScript and CSS from `raw.githubusercontent.com` using only heuristic validation—file size thresholds and string pattern matching—that attackers could trivially satisfy. The fix introduces cryptographic integrity verification by cross-referencing Git blob hashes from the GitHub Contents API, ensuring downloaded code matches the repository's authoritative state before execution.

high

adm-zip 0.6.0 Preserves SUID Bits From ZIPs: CVE-2026-102282

The `adm-zip` dependency resolved to 0.6.0 in this project's dependency tree, a version affected by CVE-2026-102282: during extraction it applies the Unix permission bits stored in each ZIP entry's external file attributes verbatim, including the setuid (`04000`), setgid (`02000`), and sticky bits. An attacker who controls an archive passed to `extractAllTo()` or `extractEntryTo()` can therefore have the extractor create a setuid binary owned by whatever user the extraction process runs as. The

high

requestInput() Type Confusion: NaN and Object Bypass in JavaScript

The `requestInput()` utility function lacked validation on its `type` parameter and failed to handle `NaN` results from float conversions, creating a type confusion weakness. An attacker could supply malformed inputs that propagate unhandled `NaN` values or unexpected object types through the type system. The fix adds explicit guards against `NaN` type parameters and rejects non-primitive type values.