CVEReports
CVEReports

Automated vulnerability intelligence platform. Comprehensive reports for high-severity CVEs generated by AI.

Product

  • Home
  • Sitemap
  • RSS Feed

Company

  • About
  • Contact
  • Privacy Policy
  • Terms of Service

© 2026 CVEReports. All rights reserved.

Made with love by Amit Schendel & Alon Barad



GHSA-HM2W-VR2P-HQ7W

GHSA-HM2W-VR2P-HQ7W: Heap Out-of-Bounds Write in uefi-firmware-parser Tiano Decompressor

Alon Barad
Alon Barad
Software Engineer

Apr 16, 2026·6 min read·17 visits

Executive Summary (TL;DR)

The uefi-firmware-parser library lacks bounds checking in its Tiano decompressor (ReadCLen function). This allows an attacker to write past the bounds of internal arrays on the heap via a crafted compressed file, achieving arbitrary code execution or DoS. Users must update to version 1.13.

A critical heap-based out-of-bounds write vulnerability exists in the Tiano/EFI decompression algorithm of the uefi-firmware-parser library. An attacker can supply a maliciously crafted compressed EFI file to corrupt heap memory, leading to potential arbitrary code execution or denial of service.

Vulnerability Overview

The uefi-firmware-parser library provides core functionality for extracting, parsing, and analyzing UEFI firmware volumes. To handle compressed EFI payloads efficiently, the library includes a native C extension that implements the Tiano and EFI decompression algorithms. This native implementation directly processes untrusted bitstreams extracted from firmware images.

A critical vulnerability exists within the Huffman table generation phase of the Tiano decompressor. The issue is classified as CWE-787 (Out-of-bounds Write) and occurs because the implementation fails to validate length values read from the compressed stream against the fixed sizes of internal data structures. This oversight creates a direct pathway for heap memory corruption.

The vulnerability is a legacy flaw resulting from porting older Tiano compression code without incorporating modern security hardening. Similar vulnerabilities were previously identified and addressed in upstream implementations like EDK2 (CVE-2017-5731 through CVE-2017-5735). The uefi-firmware-parser implementation remained unpatched against these known attack vectors until version 1.13.

Root Cause Analysis

The root cause of the vulnerability lies in the ReadCLen function located in uefi_firmware/compression/Tiano/Decompress.c. This function is responsible for reading Huffman code lengths from the compressed bitstream and storing them in the mCLen and mPTLen arrays. These arrays are members of the SCRATCH_DATA structure, which is allocated on the heap during initialization.

The mCLen array has a fixed capacity defined by the constant NC (typically 510). However, the ReadCLen function reads a user-controlled 16-bit integer, Number, directly from the bitstream using GetBits(Sd, CBIT). The function then enters a while loop that increments an Index variable up to the value of Number, writing extracted code lengths to Sd->mCLen[Index].

Because there is no boundary check ensuring that Number does not exceed NC, an attacker can specify an arbitrarily large value. This forces the loop to write data beyond the bounds of the mCLen array, corrupting adjacent heap memory. The issue is exacerbated by the Run-Length Encoding (RLE) logic within the loop, which further increments the Index variable without verification.

Code Analysis and Patch

The vulnerable implementation of ReadCLen allowed the Index variable to increment strictly based on the attacker-controlled Number variable. The snippet below highlights the lack of boundary enforcement within the RLE block.

Number = (UINT16) GetBits (Sd, CBIT);
Index = 0;
while (Index < Number) { 
    CharC = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
    // ... 
    if (CharC == 2) { 
        CharC = (UINT16) GetBits (Sd, 2);
        CharC++;
        while ((INT16) (CharC) >= 0) {
            Sd->mCLen[Index++] = 0; // VULNERABLE: OOB write
            CharC--;
        }
    }
}

The fix, introduced in pull request #145 (commit bf3dfaa8a05675bae6ea0cbfa082ddcebfcde23e), enforces strict boundary limits on all array accesses. The patch modifies the loop conditions to verify Index < NC and Index < NPT before proceeding with memory operations.

Number = (UINT16) GetBits (Sd, CBIT);
Index = 0;
while (Index < Number && Index < NC) { // PATCHED: Check against NC
    CharC = Sd->mPTTable[Sd->mBitBuf >> (BITBUFSIZ - 8)];
    // ... 
    if (CharC == 2) { 
        CharC = (UINT16) GetBits (Sd, 2);
        CharC++;
        while ((INT16) (CharC) >= 0 && Index < NC) { // PATCHED: Check against NC
            Sd->mCLen[Index++] = 0; 
            CharC--;
        }
    }
}

In addition to these bounds checks, the patch includes comprehensive state hardening ported from EDK2. The SCRATCH_DATA struct members were converted from platform-dependent size_t to explicit UINT32 to prevent integer overflow vulnerabilities during bit-buffer arithmetic. Furthermore, the FillBuf function was updated to cast mBitBuf to UINT64 prior to a 32-bit shift, resolving a critical Undefined Behavior (UB) condition.

Exploitation Mechanics

Exploiting this vulnerability requires the attacker to construct a malformed compressed EFI payload. The payload must define an initial bitstream that passes early decompressor validation but supplies a manipulated Number value when parsed by the ReadCLen function.

When the decompressor executes the malformed bitstream, the ReadCLen function extracts the oversized Number parameter. As the RLE decompression loop executes, it writes zeros (or specific extracted lengths) into heap addresses continuously past the mCLen array boundaries. This sequential overwrite allows the attacker to corrupt adjacent internal structures or other heap allocations within the Python process executing the library.

To achieve reliable arbitrary code execution, the attacker must align the target SCRATCH_DATA allocation on the heap such that critical pointers or object metadata reside immediately adjacent to the mCLen buffer. Overwriting function pointers or Python object headers can hijack the execution flow. If the allocation is not perfectly aligned, the overwrite will corrupt heap metadata, resulting in an immediate segmentation fault and a denial of service.

Impact Assessment

This vulnerability yields a maximum CVSS v3.1 score of 9.8, indicating critical severity. The attack vector is classified as Network (AV:N) because the vulnerable library is commonly used in backend pipelines, automated analysis systems, and CI/CD environments that ingest external firmware files for automated processing.

The requirement for user interaction is None (UI:N), and no specific privileges are required (PR:N). When a vulnerable pipeline processes an uploaded firmware image containing the malicious bitstream, the exploit triggers automatically during the decompression phase. The flaw affects both the confidentiality, integrity, and availability metrics (C:H/I:H/A:H) as memory corruption provides a pathway to arbitrary code execution within the context of the host process.

Successful code execution enables an attacker to compromise the analysis environment, extract sensitive firmware decryption keys from memory, pivot to internal networks, or modify analysis results. Even in scenarios where heap layouts prevent reliable code execution, the resulting segmentation fault causes persistent denial of service conditions, crashing automated firmware extraction pipelines.

Remediation and Mitigation

The primary remediation for this vulnerability is to upgrade the uefi-firmware-parser library to version 1.13 or later. The patch completely resolves the out-of-bounds write by applying correct boundary limits during the parsing of compressed length values and synchronizing the internal state mechanics with modern EDK2 hardening standards.

For systems utilizing the Python Package Index (PyPI) distribution, the upgrade should be executed via standard package management commands. Administrators must ensure that all virtual environments and container images executing firmware analysis pipelines are rebuilt to include the updated dependency.

There are no known configuration workarounds to disable the native Tiano decompression extension without breaking core library functionality. If immediate patching is not possible, security teams should implement strict ingress filtering to reject compressed EFI payloads from untrusted sources, or execute the firmware parser strictly within highly isolated, ephemeral sandboxes to contain potential execution.

Official Patches

GitHubPull Request #145 addressing the vulnerability
GitHubFix Commit applying EDK2 hardening

Fix Analysis (1)

Technical Appendix

CVSS Score
9.8/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Affected Systems

uefi-firmware-parser (GitHub)uefi_firmware (PyPI)

Affected Versions Detail

Product
Affected Versions
Fixed Version
uefi-firmware-parser
theopolis
< 1.131.13
AttributeDetail
CWE IDCWE-787
Attack VectorNetwork
CVSS Score9.8
ImpactRemote Code Execution / Denial of Service
Exploit StatusNo public PoC
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1190Exploit Public-Facing Application
Initial Access
T1203Exploitation for Client Execution
Execution
T1499Endpoint Denial of Service
Impact
CWE-787
Out-of-bounds Write

The software writes data past the end, or before the beginning, of the intended buffer.

Vulnerability Timeline

Fix merged via Pull Request #145
2026-02-27
Version 1.13 released on PyPI/GitHub
2026-02-27
GitHub Advisory GHSA-HM2W-VR2P-HQ7W published
2026-02-27

References & Sources

  • [1]GitHub Advisory GHSA-HM2W-VR2P-HQ7W

Attack Flow Diagram

Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.
Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.

More Reports

•11 minutes ago•CVE-2026-55857
5.9

CVE-2026-55857: Insecure Credential Transmission via PAM Dialog Plugin in MariaDB Connector/J

A transport-security omission in the MariaDB Connector/J driver allows remote on-path adversaries or rogue database servers to capture database credentials in cleartext. Under default configurations (sslMode=DISABLE), the driver fails to enforce encrypted channels when negotiating the Pluggable Authentication Module (PAM) 'dialog' plugin, resulting in cleartext transmission of sensitive passwords.

Amit Schendel
Amit Schendel
0 views•6 min read
•about 1 hour ago•CVE-2026-55858
5.9

CVE-2026-55858: Client/Server Charset-Confusion SQL Injection in MariaDB Connector/J

CVE-2026-55858 describes a critical encoding desynchronization vulnerability in MariaDB Connector/J (the official JDBC driver). The vulnerability stems from a mismatch between the driver's static UTF-8 client-side escaping logic and dynamic character set changes initiated on the database server. When the server character set is switched mid-session to an encoding that permits ASCII-overlapping multibyte characters (such as GBK or Big5), an attacker can supply crafted inputs to swallow escaping backslashes, resulting in SQL injection and unauthorized statement execution.

Amit Schendel
Amit Schendel
2 views•6 min read
•about 2 hours ago•CVE-2026-55859
5.9

CVE-2026-55859: Client-Server Charset Confusion in MariaDB Connector/R2DBC leading to SQL Injection

An input validation and encoding desynchronization vulnerability exists in MariaDB Connector/R2DBC versions prior to 1.4.1. The driver assumes all communication utilizes the UTF-8 character set, but fails to account for server-driven mid-session changes to the character_set_client variable. When a change to a multi-byte character set such as GBK or Big5 is induced, the server interprets client-escaped single quotes as part of a multi-byte character. This state desynchronization bypasses standard escaping mechanisms and allows remote unauthenticated attackers to execute arbitrary SQL commands.

Alon Barad
Alon Barad
6 views•5 min read
•about 3 hours ago•CVE-2026-55860
5.9

CVE-2026-55860: Cleartext Password Disclosure in MariaDB Connector/R2DBC

A security vulnerability in the MariaDB Connector/R2DBC client driver allows credential theft during the database authentication phase. The client driver does not gate clear-text password authentication plugins on transport encryption, making it possible for on-path attackers or hostile database servers to intercept passwords.

Amit Schendel
Amit Schendel
5 views•5 min read
•about 4 hours ago•CVE-2026-55830
8.3

CVE-2026-55830: Complete Sandbox Escape via Positional-Only Arguments in RestrictedPython

A critical security flaw was identified in RestrictedPython prior to version 8.3 where positional-only arguments introduced in Python 3.8 were not properly validated. This allowed an attacker executing code within the sandbox to shadow critical security guards like `_write_` and `_getattr_`, leading to a complete sandbox escape and arbitrary code execution on the underlying server.

Amit Schendel
Amit Schendel
6 views•6 min read
•about 5 hours ago•CVE-2026-55855
6.5

CVE-2026-55855: SQL Injection in MariaDB Connector/Node.js via Multi-byte Client Character Sets

CVE-2026-55855 is a client-side SQL injection vulnerability in the MariaDB Connector/Node.js library that occurs when using legacy multi-byte character sets. The flaw arises from naive, byte-wise client-side parameter escaping. Attackers can leverage specific multi-byte lead bytes to absorb backslash escape characters on the server side, allowing them to terminate string literals and execute arbitrary SQL commands.

Amit Schendel
Amit Schendel
8 views•7 min read