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-QV2Q-C278-PCH5

GHSA-qv2q-c278-pch5: Cryptographic Nonce Reuse and Information Disclosure in ImageMagick

Alon Barad
Alon Barad
Software Engineer

May 22, 2026·5 min read·5 visits

Executive Summary (TL;DR)

ImageMagick's encipher utility derives AES-CTR nonces deterministically from image dimensions and passwords, causing keystream reuse. Attackers can recover plaintext images by XORing multiple encrypted images of the same size.

ImageMagick and its .NET wrapper Magick.NET fail to generate unique Initialization Vectors (IVs) when using the PasskeyEncipherImage method with AES-CTR mode. The deterministic derivation of the IV relies solely on the passphrase and the image dimensions. This cryptographic flaw leads to nonce reuse, allowing an attacker to recover plain text pixel data via XOR operations on ciphertexts.

Vulnerability Overview

ImageMagick provides built-in mechanisms for image obfuscation via the -encipher and -decipher command-line utilities. These utilities rely on the PasskeyEncipherImage method to scramble pixel data using AES in Counter (CTR) mode. Magick.NET, the .NET wrapper for ImageMagick, exposes this same cryptographic functionality to developers handling image processing in C# applications.

The vulnerability tracked as GHSA-qv2q-c278-pch5 identifies a critical cryptographic flaw in how this enciphering process initializes its state. The implementation fails to generate a unique initialization vector (IV) for distinct encryption operations. This flaw forces the cryptographic cipher into a degraded state where it reuses the same AES keystream across multiple images.

Consequently, this deterministic behavior invalidates the security guarantees of the AES-CTR implementation. The vulnerability maps directly to CWE-323 (Reusing a Nonce, KeyPair in Polyalphabetic Cipher) and CWE-330 (Use of Insufficiently Random Values). The maintainers now classify this feature strictly as casual obfuscation rather than secure encryption.

Root Cause Analysis

AES-CTR transforms a block cipher into a stream cipher by generating a keystream, which is then XORed with the plaintext data. The security of this mode strictly requires a completely unique nonce or IV for every encryption operation under a given key. If the IV repeats, the generated keystream repeats.

In the PasskeyEncipherImage implementation, the IV derivation mechanism is entirely deterministic and relies on insufficiently variable inputs. The algorithm splits the user-supplied passphrase into two halves. It uses the first half directly as the AES encryption key and processes the second half to generate the IV.

To construct the IV, the implementation combines the second half of the passphrase with the image dimensions, specifically the width and height. It then hashes this combined string to produce the final initialization vector. Because the derivation process relies solely on the passphrase and the dimensions of the target image, encrypting any two images of identical size with the same passphrase yields the exact same IV.

Mathematical Exploitation

The exploitation of this vulnerability does not require complex software exploitation techniques or memory corruption. Instead, it relies on fundamental cryptanalysis techniques applied to stream ciphers that suffer from nonce reuse. An attacker only needs passive access to two or more ciphertext images encrypted under the identical configuration.

When the AES keystream is reused, the mathematical relationship between the ciphertexts and plaintexts becomes trivially solvable. Let the reused keystream be K, and two plaintexts be P1 and P2. The resulting ciphertexts are C1 = P1 ⊕ K and C2 = P2 ⊕ K. An attacker can XOR the two ciphertexts together, computing C1 ⊕ C2.

Because the XOR operation is commutative and self-inverting, the keystream K cancels out completely. The result is exactly P1 ⊕ P2. The attacker is left with the XOR sum of the two original unencrypted image files. From this state, the attacker applies standard crib-dragging techniques or statistical analysis to separate the individual image plaintexts, recovering the original pixel data.

Impact Assessment

The concrete security impact of GHSA-qv2q-c278-pch5 is restricted strictly to the loss of data confidentiality. The vulnerability possesses a CVSS v3.1 score of 3.7, reflecting its low severity and the specific preconditions required for exploitation. Attackers cannot leverage this flaw to achieve remote code execution, manipulate file system contents, or degrade application availability.

Data recovery requires the attacker to possess multiple images of identical dimensions encrypted with the same passphrase. In environments where an automated system scales and encrypts batch images (such as uniform profile pictures or standardized thumbnails), these preconditions are naturally met. The attacker must also possess the capability to intercept or access these stored ciphertext images.

While the technical severity is low, the vulnerability highlights a critical divergence between cryptographic expectations and implementation realities. Developers relying on Magick.NET's encipher functionality for secure data storage at rest will find their implementations vulnerable to trivial cryptographic analysis. The ImageMagick project explicitly advises treating this functionality only as a mechanism for casual obfuscation.

Remediation and Mitigation

The primary remediation for this vulnerability requires upgrading the Magick.NET library to version 14.12.0 or later. This version adjusts the cryptographic behavior or explicitly defines the functional limitations of the PasskeyEncipherImage method. Administrators managing systems that rely on the affected .NET distributions must verify their package versions via NuGet and deploy the updated builds.

If immediate patching is unfeasible, developers must alter their application logic to prevent nonce reuse. The most effective workaround requires generating a unique, cryptographically secure passphrase for every single image encryption operation. Storing a unique key per image ensures that the deterministic IV derivation process never produces identical initialization vectors.

Architecturally, security teams should deprecate the use of ImageMagick's built-in enciphering tools for protecting sensitive image data. Applications requiring secure storage of images should utilize dedicated cryptographic libraries, such as the .NET framework's AesGcm class, which handles authenticated encryption and nonce generation correctly. Image processing pipelines should strictly handle formatting and transformations, leaving encryption to purpose-built cryptographic boundaries.

Official Patches

ImageMagickGitHub Security Advisory

Technical Appendix

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

Affected Systems

ImageMagickMagick.NET

Affected Versions Detail

Product
Affected Versions
Fixed Version
Magick.NET-Q16-AnyCPU
ImageMagick
< 14.12.014.12.0
Magick.NET-Q8-AnyCPU
ImageMagick
< 14.12.014.12.0
AttributeDetail
CWE IDCWE-323
Attack VectorNetwork
CVSS Score3.7 (Low)
ImpactConfidentiality Loss
Exploit StatusTheoretical/PoC
KEV StatusNot Listed

MITRE ATT&CK Mapping

T1552Unsecured Credentials
Credential Access
CWE-323
Reusing a Nonce, KeyPair in Polyalphabetic Cipher

The cryptographic algorithm uses a nonce or initialization vector (IV) that is reused, which can compromise the security of the encryption.

Vulnerability Timeline

Vulnerability published in the GitHub Advisory Database.
2026-05-21
Documentation updated on ImageMagick.org explaining the deterministic IV derivation.
2026-05-21
Magick.NET 14.12.0 identified as the fixed version.
2026-05-22

References & Sources

  • [1]GitHub Security Advisory
  • [2]ImageMagick Cipher Documentation
  • [3]OSV Vulnerability Database Entry

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

•26 minutes ago•CVE-2024-29203
4.3

CVE-2024-29203: Client-Side Cross-Site Scripting via Unsandboxed Iframes and Legacy Embed Elements in TinyMCE

CVE-2024-29203 identifies a cross-site scripting (XSS) vulnerability in the content ingestion and parsing mechanics of TinyMCE rich text editor. Due to a failure to enforce sandbox attributes on dynamic iframe elements and safely handle legacy embed objects, unauthenticated attackers can inject malicious elements that execute scripts within the context of the parent application session.

Amit Schendel
Amit Schendel
1 views•5 min read
•about 2 hours ago•CVE-2026-9277
8.1

CVE-2026-9277: OS Command Injection in shell-quote via Object-Token Line Terminator Parsing Defect

A technical breakdown of the OS command injection vulnerability in the shell-quote NPM package (CVE-2026-9277 / GHSA-w7jw-789q-3m8p). The bug resides in the character-by-character backslash-escaping logic applied to the .op field of object-tokens within the quote() function, which fails to match and escape line terminators due to a regex matching oversight in JavaScript. This allows unauthenticated remote attackers to execute arbitrary shell commands if they can control inputs processed by this library.

Alon Barad
Alon Barad
7 views•6 min read
•about 4 hours ago•CVE-2026-11645
8.8

CVE-2026-11645: Out-of-Bounds Memory Access in Google Chrome V8 Engine

A high-severity memory corruption vulnerability exists in the V8 JavaScript engine of Google Chrome before versions 149.0.7827.102/103. The flaw arises from an incorrect bounds-check elimination during JIT compilation by the TurboFan optimizer, allowing remote attackers to achieve out-of-bounds read and write access inside the sandboxed renderer process.

Amit Schendel
Amit Schendel
19 views•6 min read
•about 12 hours 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
63 views•6 min read
•1 day 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
•1 day 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
12 views•7 min read