Security Advisory

CVE-2018-25032: zlib Deflate Memory Corruption

Last updated:
  • CVE-2018-25032

CVE-2018-25032 is a memory corruption bug in zlib's deflate (compression) code: rare inputs with many distant matches can make the pending output buffer overwrite the distance symbol table, which can crash the program. It affects zlib before 1.2.12, NVD scores it 7.5, and Siemens lists affected SCALANCE and RUGGEDCOM firmware.

Vulnerability summary

CVSS base score

7.5

High severity

EPSS score (FIRST)

51.7%

Probability of exploitation in the wild in the next 30 days

CISA KEV catalog

No

Not listed

Published

Vulnerability ID: CVE-2018-25032 · Source: NVD

Affected components

ComponentCPEVersion range
zlib (deflate)cpe:2.3:a:zlib:zlib:*:*:*:*:*:*:*:*before 1.2.12 (fixed in 1.2.12, 27 March 2022)
Siemens RUGGEDCOM RM1224, SCALANCE M-800, MUM-800 and S615—before V7.2 (fixed in V7.2, per SSA-419740)
Siemens SCALANCE SC-600 family—before V3.0 (fixed in V3.0, per SSA-333517)
Siemens SINAMICS PERFECT HARMONY GH180 (integrated SCALANCE S615)—S615 firmware before V7.2 (fixed in V7.2, per SSA-942865)

What does this mean for affected devices?

CVE-2018-25032 is an out-of-bounds write (CWE-787) on the compression side of zlib. NVD describes it as memory corruption in zlib before 1.2.12 "when deflating (i.e., when compressing) if the input has many distant matches", and gives it a Primary CVSS 3.1 score of 7.5, vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, so the scored impact is availability (NVD).

The upstream fix, committed in April 2018, explains that for "rare inputs with a large number of distant matches, the pending buffer into which the compressed data is written can overwrite the distance symbol table which it overlays", which "can result in out-of-bound accesses, crashing the application". The commit traces the bug to zlib 1.2.2.2 and the Z_FIXED option, and fixes it by merging the distance and literal/length buffers into one symbol buffer. The fix sat in the repository until Tavis Ormandy reported on oss-security in March 2022 that he had hit the crash in a compressor and that the patch "never made it into a release". zlib 1.2.12 (27 March 2022) shipped it; its ChangeLog lists "Fix a bug that can crash deflate on some input when using Z_FIXED".

Siemens ProductCERT lists network devices whose firmware bundles the vulnerable zlib. SSA-419740 covers RUGGEDCOM RM1224 LTE(4G) routers, SCALANCE M-800 and MUM-800 routers and SCALANCE S615 firewalls before V7.2, fixed by updating to V7.2. SSA-333517 covers the SCALANCE SC-600 family (SC622-2C to SC646-2C) before V3.0. SSA-942865 covers the SCALANCE S615 integrated into SINAMICS PERFECT HARMONY GH180 medium-voltage drives: update the S615 firmware to V7.2, and until then restrict physical access to the drive's front Ethernet port and disconnect direct network connections to the S615. Siemens scores the CVE 7.5 in all three advisories.

The trigger is compression, so the question for a device is whether it deflates data an attacker can shape: HTTP responses that echo request content, log or backup archives, or a firmware-update client that compresses uploads. A device that only decompresses vendor-signed images is far less exposed to this CVE. Version strings can mislead, because distributions backported the fix: the Debian tracker marks buster fixed in 1:1.2.11.dfsg-1+deb10u1 (DSA-5111-1), still a "1.2.11" package.

This CVE is not in the CISA KEV catalog as of 2026-11-16 (catalog version 2026.11.13, CISA KEV). FIRST EPSS gives it 0.517, the 99.0th percentile, in its 2026-11-15 dataset (FIRST EPSS); our KEV and EPSS prioritization guide explains how to read that next to reachability.

The fix is zlib 1.2.12 or later, or the backported patch. Our zlib, Expat and libxml2 vulnerabilities in embedded firmware guide shows how to find every zlib copy in an image, including statically linked ones, and decide which zlib CVEs apply, and the memory corruption fix guide covers verifying a bounds fix in the shipped binary.

How to fix this class of issueThis advisory's weakness class is Memory corruption. Our practical guide covers how to detect, fix, verify and disclose it: How to fix memory corruption in embedded firmware.

Evidence

  • zlib before 1.2.12 allows memory corruption when deflating if the input has many distant matches; NVD Primary CVSS 3.1 7.5 (A:H); CWE-787; published 2022-03-25. — NVD
  • Fix commit (2018-04-18): pending buffer can overwrite the distance symbol table for rare inputs with many distant matches; introduced in 1.2.2.2 with Z_FIXED; distance and literal/length buffers combined. — zlib commit 5c44459
  • Tavis Ormandy, 2022-03-24: crash reproduced in zlib 1.2.11 when compressing; patch public since 2018 but never in a release. — oss-security
  • zlib 1.2.12 (27 Mar 2022) ChangeLog: "Fix a bug that can crash deflate on some input when using Z_FIXED". — zlib ChangeLog
  • RUGGEDCOM RM1224, SCALANCE M-800/MUM-800/S615 before V7.2 affected, fix V7.2; Siemens CVSS 7.5. — Siemens SSA-419740
  • SCALANCE SC-600 family before V3.0 affected, fix V3.0. — Siemens SSA-333517
  • Integrated SCALANCE S615 of SINAMICS PERFECT HARMONY GH180: update S615 to V7.2; restrict physical access to the front Ethernet port; disconnect direct network connections to the S615. — Siemens SSA-942865
  • Debian buster fixed in 1:1.2.11.dfsg-1+deb10u1 (DSA-5111-1). — Debian Security Tracker
  • Not in the CISA KEV catalog version 2026.11.13 as of 2026-11-16. — CISA KEV
  • EPSS 0.51733, percentile 0.98967, dataset 2026-11-15. — FIRST EPSS

Related advisories

Sources

  1. NVD
  2. zlib commit 5c44459: fix deflate crash with Z_FIXED
  3. zlib ChangeLog (1.2.12)
  4. oss-security: zlib memory corruption on deflate (2022-03-24)
  5. Siemens SSA-419740 (RUGGEDCOM and SCALANCE before V7.2)
  6. Siemens SSA-333517 (SCALANCE SC-600 before V3.0)
  7. Siemens SSA-942865 (SCALANCE S615 in SINAMICS PERFECT HARMONY GH180)
  8. Debian Security Tracker
  9. CISA KEV
  10. CISA KEV data (catalog JSON)
  11. FIRST EPSS

Frequently asked questions

Does CVE-2018-25032 affect decompression in zlib?

No. NVD describes memory corruption "when deflating (i.e., when compressing)", and the upstream fix changes the deflate symbol buffers. A device is exposed when it compresses data an attacker can influence (per NVD and zlib commit 5c44459).

Which Siemens devices are affected by CVE-2018-25032?

SSA-419740 lists RUGGEDCOM RM1224, SCALANCE M-800, MUM-800 and S615 before V7.2; SSA-333517 lists the SCALANCE SC-600 family before V3.0; SSA-942865 lists the SCALANCE S615 integrated into SINAMICS PERFECT HARMONY GH180 drives (per Siemens ProductCERT).

Why was a 2018 fix assigned a CVE in 2022?

The fix was committed in April 2018 but was absent from any zlib release until 1.2.12 in March 2022, after Tavis Ormandy reproduced the crash in zlib 1.2.11 and reported it on oss-security (per the zlib commit and the oss-security post).

Is CVE-2018-25032 in the CISA KEV catalog?

No, it is absent from catalog version 2026.11.13 as of 2026-11-16. FIRST EPSS gives it 0.517, the 99.0th percentile, in the 2026-11-15 dataset (per CISA KEV and FIRST EPSS).