# JLSEC-2026-987: ImageMagick has heap buffer overflow in WriteXWDImage due to CARD32 arithmetic overflow in bytes_per_line calculation

- Severity: Medium 6.1 (CVSS:3.1, scored by Julia Security Advisories) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Published: 2026-07-30T16:02:27.435Z
- Modified: 2026-07-30T18:35:32.910Z
- Related: CVE-2026-30937, EUVD-2026-10402, GHSA-qpg4-j99f-8xcg

## Description

A 32-bit unsigned integer overflow in the XWD (X Windows) encoder can cause an undersized heap buffer allocation. When writing a extremely large image an out of bounds heap write can occur.

```
=================================================================
==741961==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x5020000083dc at pc 0x56553b4c4245 bp 0x7ffd9d20fef0 sp 0x7ffd9d20fee0
WRITE of size 1 at 0x5020000083dc thread T0
```

(As written by Julia Security Advisories.)

## Affected

- ImageMagick_jll (Julia): before 7.1.2023+0

## References

- <https://github.com/ImageMagick/ImageMagick/security/advisories/GHSA-qpg4-j99f-8xcg> (web)
- <https://github.com/advisories/GHSA-qpg4-j99f-8xcg> (web)
- <https://nvd.nist.gov/vuln/detail/CVE-2026-30937> (web)

## Sources

- Julia Security Advisories: [JLSEC-2026-987](https://osv.dev/vulnerability/JLSEC-2026-987), CC-BY-4.0, modified 2026-07-30

---

Page: https://cve.day/JLSEC-2026-987 · Whole record: https://cve.day/JLSEC-2026-987.json · Rebuilt by cve.day 2026-11-25T22:56:26.312Z
