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·33 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

•about 20 hours ago•GHSA-9Q4R-4842-93VW
7.7

GHSA-9Q4R-4842-93VW: Cross-Tenant SQL Injection in Trigger.dev TSQL Query Compiler

A critical cross-tenant SQL injection vulnerability exists in the TSQL query compiler of Trigger.dev, allowing authenticated users to bypass tenant isolation boundaries and read arbitrary ClickHouse analytics logs and execution payloads belonging to other organizations.

Alon Barad
Alon Barad
6 views•6 min read
•about 21 hours ago•GHSA-4672-HWV6-GQ62
5.4

GHSA-4672-HWV6-GQ62: Cross-environment deployment cancellation in Trigger.dev

A logical authorization bypass vulnerability exists in Trigger.dev versions prior to 4.5.6. This flaw allows an authenticated client with a low-trust environment API key, such as development or staging, to cancel active worker deployments in a higher-trust environment like production within the same project. The vulnerability occurs because write operations on deployments were scoped solely by project identifier instead of environment identifier.

Alon Barad
Alon Barad
5 views•6 min read
•about 22 hours ago•GHSA-JQMF-MX4F-HFR6
10.0

GHSA-JQMF-MX4F-HFR6: Multiple Remote Code Execution and Security Flaws in Vibe-Trading AI-Agent Pipeline

An in-depth technical analysis of multiple critical security flaws identified in the Vibe-Trading ecosystem (vibe-trading-ai). These issues range from unauthenticated remote command injection via agent tool executions to arbitrary Python execution through dynamic module loading and unsafe Jinja2 template autoescaping, allowing full system compromise.

Amit Schendel
Amit Schendel
8 views•7 min read
•about 23 hours ago•GHSA-5RMQ-CHC7-M22F
7.5

GHSA-5RMQ-CHC7-M22F: Arbitrary File Read and Path Traversal in Vibe-Trading Platform

An arbitrary file read and path traversal vulnerability in the Vibe-Trading platform allows unauthenticated remote attackers to retrieve sensitive configuration files, API keys, and system secrets. The flaw stems from permissive directory checking in path validation tools and a complete lack of input sanitization in the document reader utility. Remediation was introduced in version 0.1.7 by implementing strict path allowlists, forcing user authentication, and dropping root execution privileges within the container environment.

Alon Barad
Alon Barad
7 views•6 min read
•about 24 hours ago•GHSA-V2F8-6655-7GRJ
10.0

GHSA-v2f8-6655-7grj: Remote Code Execution and Authentication Bypass in vibe-trading-ai

The vibe-trading-ai package prior to version 0.1.7 contains multiple critical security vulnerabilities including unauthenticated remote code execution (RCE) via session message injection, missing authentication on read endpoints, unrestricted file upload, insecure CORS policies, and sensitive key disclosure. Because the application default settings failed open, ran as root within Docker, and bound to all interfaces, remote unauthenticated attackers could compromise host environments containing sensitive trading data.

Amit Schendel
Amit Schendel
9 views•6 min read
•1 day ago•CVE-2026-18140
7.5

CVE-2026-18140: Uncontrolled Recursion in aws-smithy-json Token Skipping Path

CVE-2026-18140 is a denial-of-service vulnerability in the Amazon aws-smithy-json Rust crate. Under-validation of recursion depth within the unknown-key skipping path allows a remote, unauthenticated attacker to cause stack exhaustion and process aborts by sending deeply nested JSON arrays.

Amit Schendel
Amit Schendel
8 views•6 min read