SecurinZero Days
    Email Us
    Zero-Day Research/CVE-2026-46693
    ▲ MediumCVSS 4.1

    ImageMagick Remote File Descriptor Hijacking via Race Condition

    https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-4g75-9r48-jf92

    CVE IDCVE-2026-46693
    CVSS v3.14.1 Medium
    VendorImageMagick
    CWECWE-362 Race Condition · CWE-567 Unsynchronized Shared Data Access
    DisclosedMay 13, 2026
    StatusPublished
    All advisories
    • 01Description
    • 02Proof of Concept
    • 03Vulnerable Code
    • 04Impact
    • 05Remediation
    • 06Timeline
    • 07References
    01/Description

    What this actually is.

    Technical background, root cause, and affected surface.

    https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-4g75-9r48-jf92

    Vendor
    ImageMagick
    Product
    ImageMagick
    Status
    Published
    CWE
    CWE-362 Race Condition · CWE-567 Unsynchronized Shared Data Access
    Severity
    Medium
    CVSS Score
    4.1
    Vector
    CVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N
    02/Proof of Concept

    From one request
    to root shell.

    Reproduced in a sandboxed environment. Requires only LAN or WiFi adjacency.

    4.1CVSS 3.1
    VectorCVSS:3.1/AV:L/AC:H/PR:H/UI:N/S:U/C:H/I:N/A:N
    ScopeUnchanged
    ImpactC:H / I:N / A:N
    SeverityMedium

    Prerequisite: the Distributed Pixel Cache (DPC) server is an opt-in build and must be running.

    PoC · Exploitation Steps▲ trigger
    01./configure --enable-distributed-pixel-cache magick -distribute-cache 666802Concept: open two TCP connections to the DPC port so that both accept() calls complete inside the window before either spawned worker reaches the descriptor read at distribute-cache.c:879. One worker then reads the other connection's descriptor, and the session key sent at line 880 - plus all subsequent pixel-cache traffic - is written to the wrong socket.03Steps:04Securin's reproduction harness (poc_dpc_race.py) is deliberately non-weaponized. It reports only whether cross-session routing occurred and the mis-routed byte count; it does not decode, store, or exfiltrate pixel-cache contents, and implements no image-reassembly logic.05python3 poc_dpc_race.py --host 127.0.0.1 --port 6668 --attempts 100 --verbose06A Docker harness (lab/reproduce.sh) builds ImageMagick at the vulnerable commit with the DPC server enabled, starts the service, and runs the race. Expected output on a vulnerable build:07[VULN-08 CONFIRMED] Cross-session routing observed.

    Constraint: exploitation is opportunistic rather than deterministic. The attacker cannot choose which session is hijacked, only force collisions until one occurs.

    03/Vulnerable Code

    The bug, and the fix.

    File: MagickCore/distribute-cache.c Affected functions: DistributePixelCacheServer() accept loop, and the DistributePixelCacheClient() worker.

    The accept loop declares the client socket as a loop-scoped automatic variable and passes its ADDRESS to pthread_create():

    1028 for ( ; ; ) 1029 { 1030 SOCKET_TYPE 1031 client_socket; /* one stack slot, reused every iteration */ 1032 1033 socklen_t 1034 length; 1035 1036 length=(socklen_t) sizeof(address); 1037 client_socket=accept(server_socket,(struct sockaddr *) &address,&length); 1038 if (client_socket == -1) 1039 ThrowFatalException(CacheFatalError,"UnableToEstablishConnection"); 1040 #if defined(MAGICKCORE_THREAD_SUPPORT) 1041 status=pthread_create(&threads,&attributes,DistributePixelCacheClient, 1042 (void *) &client_socket); /* <-- RACE: address of a stack variable */ 1043 if (status == -1) 1044 ThrowFatalException(CacheFatalError,"UnableToCreateClientThread"); 1045 #elif defined(_MSC_VER) 1046 if (CreateThread(0,0,DistributePixelCacheClient,(void*) &client_socket,0,&threadID) == (HANDLE) NULL)

    The spawned worker dereferences that pointer only after it has been scheduled, and only after it has already derived the session key:

    0866 shared_secret=GetPolicyValue("cache:shared-secret"); 0871 session_key=GetMagickSignature(nonce); 0879 client_socket=(*(SOCKET_TYPE *) socket); /* <-- late read of the shared slot */ 0880 count=dpc_send(client_socket,sizeof(session_key),&session_key);

    Root cause: pthread_create()'s void *arg must outlive the child thread's first read of it. Here a single stack slot backs every connection, so the next accept() at line 1037 overwrites the value before a not-yet-scheduled worker reaches line 879. That worker then reads a file descriptor belonging to a different connection.

    The pointer itself remains valid throughout, so nothing faults and no crash is produced - the server silently serves one client's session over another client's socket, and sends the victim session's key to the wrong peer at line 880. The identical defect is present on the Windows CreateThread() path at line 1046.

    04/Impact

    What an attacker does to you.

    Post-exploitation outcomes mapped to CVSS impact metrics.

    Medium

    A hijacked descriptor causes a worker thread to send its freshly derived session key, and then serve pixel-cache reads, over a socket belonging to a different client. An attacker who wins the race receives raw pixel data from a concurrent session; on a shared or multi-tenant host that can be another tenant's image content moving through an upload or transformation pipeline. Because the session key is transmitted at distribute-cache.c:880 before the descriptor is tied to any client identity, the hijack also hands the attacker the credential for the victim's session, compounding the separate weakness that DPC session keys are echo-verified in cleartext.

    CIA Impact

    C:H · I:N · A:N

    CWE-362 Race Condition · CWE-567 Unsynchronized Shared Data Access

    05/Remediation

    Fix it. In this order.

    A runbook, not a checklist. Sequence matters — assume compromise before you act.

    01

    Upgrade. Fixed in ImageMagick 7.1.2-23 and 6.9.13-48. Magick.NET users should move to 14.12.0 or later. Debian shipped the fix in DSA-6298-1.

    N/A
    02

    Upstream fix (commit 9971127, 14 May 2026) replaces the shared stack slot with a per-connection heap allocation, addressing the underlying pthread_create() argument-lifetime bug rather than merely narrowing the window:

    N/A
    03

    the accept loop allocates a SOCKET_TYPE with AcquireMagickMemory() on each iteration, stores the accepted descriptor there, and passes that pointer to pthread_create() / CreateThread();

    N/A
    04

    DistributePixelCacheClient() copies the value out of the allocation and releases it with RelinquishMagickMemory();

    N/A
    05

    both thread-creation paths now close the socket and free the allocation when thread creation fails.

    N/A
    06

    An equivalent and allocation-free fix is to pass the descriptor by value instead of by reference - (void *)(intptr_t) client_fd, recovered in the worker as (SOCKET_TYPE)(intptr_t) arg - which removes the shared object entirely and cannot fail under memory pressure.

    N/A
    07

    Mitigations where upgrading is not immediately possible:

    N/A
    08

    Do not run the DPC server. It is opt-in: rebuild without --enable-distributed-pixel-cache, or simply do not start magick -distribute-cache.

    N/A
    09

    If it must run, bind it to loopback or an isolated segment and firewall the port (default 6668) so only trusted peers can connect. The DPC protocol provides no transport authentication or encryption of its own.

    N/A
    10

    Do not share a single DPC server across tenants or trust boundaries; run one per trust domain.

    N/A
    11

    Set a strong cache:shared-secret policy value. This constrains who can complete a session but does not close the race, since the descriptor is read after the key is derived.

    N/A
    12

    Monitor for repeated short-lived connection pairs to the DPC port, and for image operations failing with DPC protocol errors, which is the observable side effect of a won race.

    N/A
    Securin advisory — For coordinated remediation support or threat-actor briefings related to CVE-2026-46693, contact disclose@securin.io
    06/Disclosure Timeline

    Vendors moved in days.
    Attackers in hours.

    Reconstructed from vendor advisories, CISA bulletins, and Securin research records.

    2026-05-13

    Race condition identified in the ImageMagick Distributed Pixel Cache accept loop and reported to the ImageMagick maintainers via GitHub Security Advisory

    2026-05-13

    CVE-2026-46693 disclosure date recorded; Securin Zero-Day advisory published

    2026-05-14

    Upstream fix committed (9971127): per-connection heap allocation replaces the shared stack slot on both the pthread_create and CreateThread paths

    2026-05-14

    Fix landed for release in ImageMagick 7.1.2-23 and 6.9.13-48, tracked as GitHub Security Advisory GHSA-4g75-9r48-jf92

    2026-05-26

    Debian Security Advisory DSA-6298-1 ships the fix to distribution users

    Disclosed 0 days after discovery

    07/References

    Cite, verify, go deeper.

    Primary sources — NVD, CISA KEV, and machine-readable IoC feed.

    NVD

    NVD — CVE-2026-46693

    nvd.nist.gov/vuln/detail/CVE-2026-46693 →
    SEC

    Securin VI — Full Technical Analysis

    vi.securin.io →

    Let Securin level up your security posture.

    Get a live exposure assessment, threat-actor briefing tailored to your sector, and IoC mapping for your SIEM.

    Browse all advisories
    SecurinSecurinZero Days

    Securin's zero-day research operation combines frontier AI models with a decade of offensive expertise — discovering, validating, and coordinating the disclosure of high-impact vulnerabilities at a scale and speed no human team achieves alone.

    Glossary
    © 2026 Securin Inc · CVE Numbering Authority
    Privacy Policy·Data Processing Addendum