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-JQQ5-8PX3-9M6M

GHSA-JQQ5-8PX3-9M6M: Single-Byte Heap Overflow Bypass in ImageMagick JSON and YAML Encoders

Alon Barad
Alon Barad
Software Engineer

May 22, 2026·6 min read·9 visits

Executive Summary (TL;DR)

ImageMagick < 7.1.2-19 and Magick.NET < 14.12.0 suffer from a single-byte heap overflow in their JSON/YAML encoders. An incomplete patch for a prior vulnerability allows an attacker to cause a denial of service via a crafted file.

A heap-based buffer overflow vulnerability exists in the JSON and YAML encoders of ImageMagick and Magick.NET. This issue constitutes an incomplete fix for CVE-2026-40169, resulting in a single-byte out-of-bounds write (off-by-one error) during image metadata serialization.

Vulnerability Overview

ImageMagick and its .NET wrapper, Magick.NET, utilize specific encoder modules to serialize image metadata and pixel data into various text-based formats. The JSON and YAML encoders are responsible for parsing internal image structures and formatting them into standards-compliant structured text. This functionality is often exposed in automated image processing pipelines where metadata extraction is required.

Vulnerability GHSA-JQQ5-8PX3-9M6M represents a heap-based buffer overflow condition within these specific encoders. The defect is classified under CWE-122 (Heap-based Buffer Overflow) and more specifically CWE-193 (Off-by-one Error). This flaw allows an attacker to write exactly one byte beyond the allocated bounds of a heap buffer during the serialization process.

The issue stems from an incomplete remediation applied to a preceding vulnerability tracked as CVE-2026-40169. While the original patch attempted to sanitize boundary conditions during metadata formatting, it failed to account for a specific edge case. Consequently, the mitigation was bypassed, leaving applications processing untrusted images vulnerable to memory corruption.

Root Cause Analysis

The core defect resides in the memory allocation and boundary checking logic within the coders/json.c and coders/yaml.c source files. When ImageMagick exports image data to JSON or YAML, it dynamically calculates the required buffer size based on the length of the input strings and the structural overhead of the output format.

In the vulnerable implementation, the size calculation routine contained a subtle arithmetic error when processing specific image properties or metadata fields. The allocation routine provisioned a buffer that was exactly one byte too small to hold the fully formatted string and its mandatory null-terminating character.

During the final memory write operation, the string formatting function appends the null terminator to the end of the constructed string. Because the buffer was under-allocated by a single byte, this terminating character is written to the memory address immediately following the allocated heap chunk. This behavior directly corrupts the adjacent memory region managed by the heap allocator.

Code Analysis

The patch analysis requires examining the commit that introduced the security refinement. The vulnerable code calculated the required string length using a loop that aggregated the lengths of individual metadata components. However, it omitted the necessary padding required for the final formatting token or the null terminator.

// Vulnerable snippet representation (prior to 7.1.2-19)
size_t buffer_length = CalculateMetadataLength(image);
// Missing +1 for the terminator in specific edge cases
char *json_buffer = (char *) AcquireQuantumMemory(buffer_length, sizeof(char));
 
// ... string construction loop ...
 
// The following write exceeds the buffer by 1 byte
json_buffer[buffer_length] = '\0'; 

The remediation implemented in commit 84a15bf introduces a strict bound calculation that comprehensively accounts for all formatting characters and terminating bytes. The patch ensures that the AcquireQuantumMemory allocation request matches the exact maximum required size of the final serialized payload.

// Patched snippet representation (7.1.2-19 and later)
size_t buffer_length = CalculateMetadataLength(image);
// Explicitly allocate space for the null terminator
char *json_buffer = (char *) AcquireQuantumMemory(buffer_length + 1, sizeof(char));
 
// ... string construction loop ...
 
json_buffer[buffer_length] = '\0'; 

By properly aligning the buffer length with the structural requirements of the serialization format, the patch eliminates the off-by-one write condition. The allocator now provisions a chunk large enough to safely contain the entire string sequence without overflowing into adjacent memory.

Exploitation Mechanics

Exploitation of this vulnerability requires the target application to process a specially crafted image file and export it using the affected JSON or YAML formatters. The attacker does not require authentication, provided the application accepts unauthenticated file uploads for processing. The execution trigger typically occurs when a command line or API call explicitly requests the JSON or YAML output format.

Upon processing the crafted file, the off-by-one write deposits a single byte, often a null byte (0x00), into the metadata of the adjacent heap chunk. In standard heap implementations like glibc ptmalloc, overwriting the least significant byte of a chunk's size field alters the allocator's perception of available memory boundaries.

While a single-byte overwrite typically results in application denial of service via a segmentation fault during subsequent allocator operations, sophisticated exploitation paths exist. By precisely manipulating the heap layout through prior allocations, an attacker can align the target chunk with a victim object. Overwriting the size field can lead to overlapping chunks, which provides a primitive for broader memory corruption and potential code execution.

Impact Assessment

The primary impact of this vulnerability is an application-level denial of service. The memory corruption triggered by the out-of-bounds write disrupts the internal state of the heap allocator. When the application subsequently attempts to allocate or free memory, the corrupted chunk metadata causes the process to abort, terminating the service.

The CVSS 3.1 vector evaluates this vulnerability as AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, resulting in a moderate severity score of 6.2. The local attack vector classification indicates that the attacker must provide a file to the system, though in web application contexts where image processing is exposed to external users, this is effectively remotely exploitable.

Confidentiality and integrity are generally not impacted by a straightforward denial of service attack utilizing this vector. However, if an attacker successfully pivots the single-byte overwrite into a reliable overlapping chunks exploit, the impact score would elevate significantly, as arbitrary code execution could compromise the entire host system.

Remediation and Mitigation

The definitive resolution for GHSA-JQQ5-8PX3-9M6M requires updating the affected software to the patched versions. ImageMagick core installations must be upgraded to version 7.1.2-19 or later. Applications utilizing the Magick.NET wrapper must update their NuGet package dependencies to version 14.12.0 or later across all target architectures.

For environments where immediate patching is not feasible, administrators can implement defense-in-depth mitigations by restricting the functionality of the ImageMagick delegators. Modifying the policy.xml configuration file to explicitly deny the execution of the JSON and YAML coders prevents the vulnerable code paths from being reached.

<policymap>
  <policy domain="coder" rights="none" pattern="JSON" />
  <policy domain="coder" rights="none" pattern="YAML" />
</policymap>

This configuration change serves as an effective temporary workaround. Security teams should verify that this restriction does not disrupt critical business logic that relies on metadata extraction into these specific formats.

Official Patches

Magick.NETRelease Notes for Magick.NET 14.12.0

Technical Appendix

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

Affected Systems

ImageMagick CoreMagick.NET NuGet Packages

Affected Versions Detail

Product
Affected Versions
Fixed Version
ImageMagick
ImageMagick
< 7.1.2-197.1.2-19
Magick.NET
Dirk Lemstra
< 14.12.014.12.0
AttributeDetail
CWE IDCWE-122, CWE-193
Attack VectorLocal / Remote via File Upload
CVSS Score6.2
ImpactDenial of Service (DoS)
Exploit StatusProof of Concept (PoC) Exists
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1203Exploitation for Client Execution
Execution
T1499.004Endpoint Denial of Service: Application Exhaustion
Impact
T1059Command and Scripting Interpreter
Execution
CWE-122
Heap-based Buffer Overflow

Heap-based Buffer Overflow / Off-by-one Error

Known Exploits & Detection

Private Researcher (007bsd)A Proof-of-Concept demonstrating the crash exists in the private researcher community.

Vulnerability Timeline

Original Vulnerability (CVE-2026-40169) Disclosed
2026-04-14
Bypass Discovered
2026-04-25
GHSA-JQQ5-8PX3-9M6M Published
2026-05-04
Patch Released (Magick.NET 14.12.0)
2026-05-15

References & Sources

  • [1]GitHub Advisory Database
  • [2]ImageMagick Security Advisory
  • [3]Original Vulnerability (CVE-2026-40169)
  • [4]Magick.NET Release Notes
Related Vulnerabilities
CVE-2026-40169

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

•33 minutes ago•CVE-2026-50751
9.3

CVE-2026-50751: Authentication Bypass in Check Point Security Gateway IKEv1 Legacy Validation

An improper authentication vulnerability (CWE-287) exists in the legacy, deprecated Internet Key Exchange version 1 (IKEv1) key exchange protocol implementation in Check Point Security Gateways. The vulnerability is caused by a logic flow weakness during the certificate validation process for Remote Access VPN and Mobile Access (SSL VPN) connections. An unauthenticated remote attacker can exploit this weakness to bypass user authentication entirely, establishing a fully functional Remote Access VPN connection without a valid password.

Alon Barad
Alon Barad
4 views•6 min read
•about 14 hours ago•CVE-2026-39922
6.3

CVE-2026-39922: Server-Side Request Forgery in GeoNode Service Registration Endpoint

GeoNode versions prior to 4.4.5 and 5.0.2 are vulnerable to Server-Side Request Forgery (SSRF) in the service registration endpoint. Authenticated attackers with low privileges can exploit insufficient input validation in the Web Map Service (WMS) registration module to force the application server to make outbound network queries to loopback addresses, private RFC1918 subnets, link-local scopes, and cloud metadata endpoints. This technical report details the mechanics of the vulnerability, the underlying architectural flaw, and how to effectively remediate and mitigate the associated security risks.

Alon Barad
Alon Barad
4 views•7 min read
•about 23 hours ago•CVE-2022-0492
7.8

CVE-2022-0492: Privilege Escalation and Container Escape via cgroups v1 release_agent

CVE-2022-0492 is a high-severity missing authorization vulnerability in the Linux kernel's Control Groups (cgroups) v1 implementation. The flaw resides within the cgroup_release_agent_write function in kernel/cgroup/cgroup-v1.c, where the kernel fails to validate if the process writing to the release_agent file possesses administrative capabilities in the initial user namespace. This allows a local attacker inside a container with root privileges (UID 0) to abuse user namespaces, mount a cgroups v1 directory, modify the release_agent parameter, and execute arbitrary commands on the host system as host root, effectively achieving a complete container escape.

Amit Schendel
Amit Schendel
9 views•7 min read
•3 days ago•GHSA-G72G-R7M4-9X4G
6.3

GHSA-G72G-R7M4-9X4G: Insufficient Session Expiration of OAuth Tokens in NocoDB

NocoDB is subject to an insufficient session expiration vulnerability where OAuth access and refresh tokens are not invalidated or revoked during security-sensitive actions such as password changes, forgot-password requests, or password resets. This allows an attacker possessing an active OAuth token to maintain unauthorized persistence.

Amit Schendel
Amit Schendel
12 views•6 min read
•3 days ago•GHSA-FGMC-2HQJ-86V4
6.9

GHSA-FGMC-2HQJ-86V4: Default Administrative Credentials in vantage6-server

A vulnerability in the vantage6 federated learning framework allows unauthenticated remote attackers to gain administrative control of the server via hardcoded default credentials (root/root) when deployed under default configurations in versions 4.2.3 and below.

Amit Schendel
Amit Schendel
8 views•5 min read
•3 days ago•GHSA-X9F6-9RVM-MMRG
6.9

GHSA-X9F6-9RVM-MMRG: Improper Access Control and Volume Mount Isolation Bypass in vantage6 Node

An improper access control vulnerability in the vantage6 node component allows concurrently running algorithm containers to read and modify sensitive input and output files of other tasks. The lack of strict workspace directory isolation exposes a significant attack surface in multi-tenant or federated environments where untrusted algorithms are executed.

Amit Schendel
Amit Schendel
3 views•4 min read