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



CVE-2026-46599

CVE-2026-46599: Unrestricted Memory Allocation in golang.org/x/image/tiff PackBits Decoder

Alon Barad
Alon Barad
Software Engineer

Jul 6, 2026·7 min read·34 visits

Executive Summary (TL;DR)

Unrestricted PackBits decompression in golang.org/x/image/tiff allows unauthenticated remote attackers to trigger denial of service via memory exhaustion using a crafted 2MB TIFF image that decompresses to 745MB.

CVE-2026-46599 (also identified by Go vulnerability alias GO-2026-5032) is a high-severity denial-of-service vulnerability in the Go image repository, specifically within the TIFF decoder's PackBits decompression engine. A lack of resource limits during the parsing of Run-Length Encoded PackBits streams allows an attacker to construct a crafted TIFF image that achieves significant decompression amplification. This flaw enables an unauthenticated remote attacker to exhaust system resources, leading to an Out-of-Memory crash or a prolonged application hang.

Vulnerability Overview

The golang.org/x/image/tiff package provides an official decoder for Tagged Image File Format (TIFF) files in the Go programming language ecosystem. Because image decoding is a resource-intensive operation, processing untrusted file inputs exposes applications to potential resource exhaustion attacks. When applications ingest user-provided images to generate thumbnails, store avatars, or perform format conversion, they rely on the decoding library to safely restrict resource consumption.

This vulnerability, designated as CVE-2026-46599, resides specifically in the implementation of the PackBits decompression scheme inside the TIFF decoder. PackBits is a byte-oriented Run-Length Encoding (RLE) standard used to compress image data strips within a TIFF container. The vulnerability falls under the CWE-770 classification (Allocation of Resources Without Limits or Throttling), indicating that the software allocates system memory on behalf of an untrusted source without enforcing an upper bound.

Unlike more complex compression algorithms in the same package that route inputs through safe buffers with size limitations, the PackBits decoder directly processed data blocks without measuring or constraining the output size. The resulting impact is high-severity denial-of-service (DoS) via complete exhaustion of available system memory. Unauthenticated remote attackers can exploit this flaw by delivering a maliciously structured TIFF file to any Go application that decodes TIFF images.

Technical Root Cause Analysis

PackBits operates on a simple state machine where each compression run begins with a signed 8-bit header byte, followed by literal or replicated data bytes. A header byte n between 0 and 127 indicates a literal run, meaning the decoder must copy the next n + 1 bytes directly to the destination. A header byte n between -127 and -1 indicates a replicated run, instructing the decoder to duplicate the single subsequent byte -n + 1 times. The value -128 is a no-op.

A replicated run can compress up to 128 bytes of repeated data into just 2 bytes of input (the header byte and the repeated byte). This structure provides a maximum single-run compression ratio of 64x. By chaining multiple replicated runs across multiple strips of a single TIFF file, an attacker can construct a high-ratio compression bomb that requires minimal input data but produces a disproportionate volume of output bytes.

The root cause of this vulnerability lies in the path routing of the main Decode function in tiff/reader.go. While other decompression algorithms such as LZW, Deflate, and CCITT restrict buffer expansion by employing the readBuf utility, the PackBits parser called unpackBits directly with a raw reader. Inside unpackBits in tiff/compress.go, the decompression loop repeatedly appended data to a destination byte slice until the input reader returned io.EOF, neglecting to verify whether the accumulated size of the buffer had exceeded the maximum safe limit configured for a single image strip.

Code and Patch Analysis

To understand the implementation flaw, we can analyze the vulnerable code path compared to the corrected logic in the official patch. In the unpatched version of unpackBits, the function signature only accepted an io.Reader and returned the raw decompressed byte slice.

// Unpatched version of unpackBits
func unpackBits(r io.Reader) ([]byte, error) {
    buf := make([]byte, 128)
    dst := make([]byte, 0, 1024)
    br, ok := r.(byteReader)
    // ... decoding loop reads codes and appends to dst ...
    for {
        // ... read headers and copy
        if code >= 0 {
            dst = append(dst, buf[:code+1]...)
        } else if code != -128 {
            dst = append(dst, buf[:1-code]...)
        }
    }
}

The patch (commit fe8ae458fe5e09e39a635719a8c2ec5393d0e815) mitigates this behavior by adding an explicit upper bound limit (lim int64) to the unpackBits parameter list. During each iteration of the decoding loop, the routine evaluates the length of the destination slice against this threshold.

// Patched version of unpackBits
func unpackBits(r io.Reader, lim int64) ([]byte, error) {
    buf := make([]byte, 128)
    dst := make([]byte, 0, 1024)
    // ... parsing loop
    for {
        // ... decode literal or replicated runs
        if code >= 0 {
            dst = append(dst, buf[:code+1]...)
        } else if code != -128 {
            dst = append(dst, buf[:1-code]...)
        }
        // Explicit size validation added to prevent memory exhaustion
        if int64(len(dst)) > lim {
            return nil, FormatError("PackBits: decompressed data too large")
        }
    }
}

Additionally, the calling site in tiff/reader.go was updated to pass blockMaxDataSize as the limit argument. This aligns the PackBits decompression path with the limits previously established for other image compression formats under CVE-2023-29408, ensuring consistent protection across all codecs.

Exploitation and Attack Methodology

Exploiting this vulnerability does not require any specific target configuration, prior authentication, or complex cryptographic operations. The attack vector is entirely remote and requires only that the target application exposes an endpoint accepting TIFF images for processing.

An attacker begins by creating a TIFF file containing a single large strip compressed with PackBits. The payload consists of repetitive byte sequences that map directly to high-amplification replicated runs (such as repeated headers of 0x81 followed by a null byte). A crafted payload of 2MB can easily expand to 745MB of memory upon decompression. This translates to an amplification factor of over 370x.

When the application receives the file, it calls tiff.Decode(). The library parses the TIFF tags, identifies the PackBits compression scheme (tag value 32773), and hands the file descriptor to the vulnerable unpackBits function. As the engine loops through the compressed runs, it continuously expands the buffer. This triggers excessive physical memory consumption within milliseconds, exhausting available memory, triggering garbage collection thrashing, and forcing the operating system to issue a SIGKILL signal to terminate the application.

Impact Assessment

The primary security impact of CVE-2026-46599 is a complete denial of service. Because image parsing is often executed synchronously in response to HTTP requests, a single request containing a malicious payload can crash the backend server, terminating all active sessions and transactions processed by that instance.

If the application is configured to automatically restart upon failure, an attacker can repeatedly send the malicious payload to keep the server in a continuous loop of crashing and restarting. This permanently denies access to legitimate users. In cloud environments where container orchestrators automatically spin up new instances, this attack can rapidly inflate hosting costs by driving CPU usage and memory resource limits to their maximum thresholds.

The CVSS v3.1 score for this vulnerability is 7.5 (High), reflecting a network-based, low-complexity vector with high availability impact. No confidentiality or integrity impact is present, as the vulnerability does not allow memory disclosure or arbitrary code execution.

Remediation and Mitigation Guidance

The definitive resolution for CVE-2026-46599 is to update the Go subrepository dependency to a secure release. Developers should upgrade the golang.org/x/image package to version v0.41.0 or higher.

To apply the update, run the following commands in the directory containing the go.mod file of your project:

go get golang.org/x/image@v0.41.0
go mod tidy

After updating the dependency, you must rebuild and redeploy all application binaries. Because Go compiles dependencies statically into the final executable, simply updating the libraries on the server host without recompiling the application will not apply the security patch.

For systems where immediate updating is not feasible, temporary workarounds can mitigate the risk. Implement a middleware layer that inspects the request body size and blocks files with .tiff or .tif extensions. Alternatively, parse the file headers to verify the magic bytes (0x49492A00 or 0x4D4D002A) and reject all TIFF payloads at the application boundary prior to invoking any image decoding functions.

Official Patches

GoGerrit Change Review (CL 759960)

Fix Analysis (1)

Technical Appendix

CVSS Score
7.5/ 10
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
EPSS Probability
0.35%
Top 73% most exploited

Affected Systems

Go ecosystem applications using golang.org/x/image/tiffTailscale clients and mesh componentsRclone cloud storage utilitiesGitea self-hosted Git servicesKubescape CLI scannerEcho web framework-driven backend services parsing multipart image structures

Affected Versions Detail

Product
Affected Versions
Fixed Version
golang.org/x/image/tiff
Go
< v0.41.0v0.41.0
AttributeDetail
CWE IDCWE-770 (Allocation of Resources Without Limits or Throttling)
Attack VectorNetwork (AV:N)
CVSS Score7.5 (High)
EPSS Score0.00353
EPSS Percentile27.35%
Exploit StatusNo public functional exploit code (None/PoC-only)
KEV StatusNot in CISA's Known Exploited Vulnerabilities (KEV) catalog

MITRE ATT&CK Mapping

T1499.004System Resource Exhaustion
Impact
CWE-770
Allocation of Resources Without Limits or Throttling

The software allocates a resource (memory buffer) on behalf of an untrusted actor without a cap or restriction on the size of the allocation.

Vulnerability Timeline

Gerrit Change CL 759960 is created to track PackBits decompression resolution
2026-03-27
Code fix is authored by contributor in the golang/image repository
2026-04-04
Go Issue 79577 is registered to track excessive resource consumption
2026-05-21
CVE-2026-46599 is officially assigned and published; Go advisory GO-2026-5032 released
2026-05-29
NVD finalizes CVSS scoring and CWE assignments
2026-06-17

References & Sources

  • [1]NVD Record for CVE-2026-46599
  • [2]CVE.org Authority Record
  • [3]Go Vulnerability Database Entry
  • [4]Go Issue Tracker Thread
Related Vulnerabilities
CVE-2023-29408

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

•about 8 hours ago•CVE-2026-54068
5.9

CVE-2026-54068: Unauthenticated Server-Side Template Injection and SQLite Exfiltration in SiYuan PKM

An authentication bypass in the SiYuan personal knowledge management system before version 3.7.0 exposes a dynamic icon rendering endpoint. This endpoint processes client-supplied Go template directives. By submitting a crafted request, an unauthenticated remote attacker can leverage registered database template functions to execute arbitrary read-only SQL queries and exfiltrate workspace contents.

Amit Schendel
Amit Schendel
5 views•5 min read
•about 8 hours ago•CVE-2026-54069
9.1

CVE-2026-54069: Authentication Bypass in SiYuan Note via Origin Header Spoofing

CVE-2026-54069 is a critical authentication bypass vulnerability in the SiYuan Note personal knowledge management system. The flaw is located in the HTTP server's middleware handling API authorization, which unconditionally trusts requests carrying a 'chrome-extension://' scheme in the Origin HTTP header, granting administrative access without validating API tokens.

Alon Barad
Alon Barad
4 views•5 min read
•about 9 hours ago•CVE-2026-54089
9.1

CVE-2026-54089: Authentication Bypass by Spoofing in File Browser

CVE-2026-54089 is a critical authentication bypass vulnerability in File Browser affecting instances configured with proxy-based authentication. An unauthenticated remote attacker with direct network access can impersonate arbitrary users or register new accounts by spoofing configured HTTP headers.

Amit Schendel
Amit Schendel
4 views•7 min read
•about 9 hours ago•GHSA-99J7-FHR2-XFJ4
10.0

GHSA-99J7-FHR2-XFJ4: Malicious Remote Code Execution Payload in 'exploration' Cargo Crate

The malicious Cargo package 'exploration' was uploaded to the crates.io registry. During compilation or package import, the crate executes code designed to establish an outbound TCP/HTTP connection, download an external second-stage binary, and execute the binary locally on the host machine. This creates an unauthenticated remote code execution vector impacting developer environments and continuous integration pipelines.

Amit Schendel
Amit Schendel
7 views•6 min read
•about 10 hours ago•CVE-2026-54088
9.3

CVE-2026-54088: Pre-Authentication Remote Code Execution in File Browser Hook Authentication

CVE-2026-54088 is a critical command injection vulnerability in File Browser prior to version 2.63.6. When Hook Authentication is enabled, the application interpolates unsanitized credentials into a shell command, allowing unauthenticated remote code execution.

Alon Barad
Alon Barad
6 views•6 min read
•about 10 hours ago•GHSA-QV4M-M73M-8HJ7
8.8

GHSA-qv4m-m73m-8hj7: Authenticated Arbitrary File Upload leading to Remote Code Execution in NotrinosERP

An authenticated remote code execution vulnerability exists in NotrinosERP (versions up to and including 1.0.0) within the Human Resource Management (HRM) module. Users with employee management permissions can upload arbitrary file types, including PHP scripts, which are written directly to a web-accessible directory. This allows for arbitrary code execution in the context of the web-server user.

Alon Barad
Alon Barad
5 views•6 min read