May 22, 2026·5 min read·26 visits
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.
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.
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.
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.
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.
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.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:N/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Magick.NET-Q16-AnyCPU ImageMagick | < 14.12.0 | 14.12.0 |
Magick.NET-Q8-AnyCPU ImageMagick | < 14.12.0 | 14.12.0 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-323 |
| Attack Vector | Network |
| CVSS Score | 3.7 (Low) |
| Impact | Confidentiality Loss |
| Exploit Status | Theoretical/PoC |
| KEV Status | Not Listed |
The cryptographic algorithm uses a nonce or initialization vector (IV) that is reused, which can compromise the security of the encryption.
CVE-2026-11746 is a critical vulnerability in Central Dogma Server prior to version 0.84.0, where an embedded ZooKeeper replication secret silently falls back to a publicly known, hard-coded default string ('ch4n63m3'). Remote attackers with access to the replication network can authenticate as legitimate cluster peers, potentially leading to unauthorized data exposure, state manipulation, or complete cluster takeover.
A logical verification flaw in ZITADEL's external JWT Identity Provider validation allows attackers to bypass session expiration checks. If an incoming JWT lacks the 'exp' claim, the system skips validation entirely, creating an indefinitely valid session. This issue has been addressed in versions 3.4.12 and 4.15.2.
CVE-2026-59149 identifies a directory traversal vulnerability in `@mockoon/commons-server`, the backend mock-server library powering the Mockoon application. The flaw occurs in the path containment validation logic used during raw file response generation. An unauthenticated attacker can exploit this weakness to retrieve arbitrary files from sibling directories sharing a common prefix with the designated static base directory.
An in-depth analysis of CVE-2026-59148, a high-severity flaw in Mockoon where unauthenticated administrative endpoints and a wildcard Cross-Origin Resource Sharing (CORS) policy allow remote execution, state poisoning, and credential theft.
An improper authentication vulnerability (CWE-287) in ZITADEL's external identity provider handler before version 4.15.3 allows remote attackers to perform complete account takeover. When auto-linking by email is enabled, ZITADEL verifies that the local target account has a verified email address but fails to verify if the external provider confirmed ownership of that same email. Attackers can exploit this by registering an unverified account with a victim's email address on a permissive external provider, leading to unauthorized account binding and persistent access.
A critical authentication bypass and cross-tenant account takeover vulnerability exists in the Prowler cloud security platform due to improper validation of the SAML Assertion Consumer Service (ACS) flow. An authenticated attacker controlling a custom Identity Provider (IdP) can forge assertions targeting arbitrary user identities across distinct tenants, allowing complete unauthorized access to target tenant-scoped resources.