Średnia

Grav: Decompression-bomb size cap bypassed by forged ZIP size in ZipArchiver/Installer

  • Ujawniono: 17.09.2026
  • Aktualizacja: 11.10.2026 10:22

Summary

The decompression-bomb bound added in 2.0.1 (commit 1c1003c) sums ZipArchive::statIndex($i)['size'] and rejects an archive whose declared uncompressed total exceeds system.gpm.archive.max_uncompressed_size (default 1 GiB) before extracting (ZipArchiver.php:77-86; same logic in GPM\Installer::unZip at Installer.php:228-238). statIndex()['size'] is the uncompressed size declared in the ZIP central directory, which is attacker-forgeable and is not checked against the actual inflated stream. An archive declaring 1 byte per entry passes the cap while extractTo() writes the real (large) content. The entry-count and nesting-depth caps count real structure and still hold; only the size dimension is defeated, so the disk-fill / inode-exhaustion case the bound targets is not prevented. Incomplete fix for GHSA-928x-9mpw-8h56.

Details

extract()/unZip() validate every entry up front, then call Folder::create + extractTo. The size check is:

php
$totalSize += (int) $stat['size'];          // declared central-directory size
if ($maxSize > 0 && $totalSize > $maxSize) { ... reject ... }

$stat['size'] is read from the central directory, which the archive author writes. libzip does not cross-check declared-vs-actual size during extractTo, so a forged-small value passes the gate and the real stream inflates to disk. The max_files (entry count) and max_depth (entry-name segments) checks are not forgeable this way.

PoC

Build a 10 KiB deflate ZIP of 10 MiB of zeros, patch both uncompressed-size fields (local header + central directory) to 1:

python
import zipfile, struct
data = b'\x00' * (10*1024*1024)
with zipfile.ZipFile('bomb.zip','w',zipfile.ZIP_DEFLATED) as z:
    z.writestr('big.bin', data)
raw = bytearray(open('bomb.zip','rb').read())
raw = raw.replace(struct.pack('<I', 10*1024*1024), struct.pack('<I', 1))
open('bomb_forged.zip','wb').write(raw)

Drive the exact pre-extraction loop, then extract:

php
$zip = new ZipArchive(); $zip->open('bomb_forged.zip');
$total = 0;
for ($i = 0; $i < $zip->count(); $i++) { $total += (int) $zip->statIndex($i)['size']; }
// => $total === 1   (what the 1 GiB bound checks: PASSES)
$zip->extractTo('/tmp/zout');
// => filesize('/tmp/zout/big.bin') === 10485760   (written despite the cap)

Verified on Grav 2.0.1 (6f619f0ae), PHP 8.4.22, libzip 1.7.3.

Impact

A forged archive fills the disk / exhausts inodes during extraction. Reached via GPM\Installer::unZip (gpm install / direct-install / self-upgrade) and admin backup restore (ZipArchiver::extract). The archive bytes come from a package source or an admin upload, so the actor sits at admin/operator trust and a consented malicious package already has worse primitives.

Fix

ZipArchiver.php:77-86 and Installer.php:228-238: don't trust the declared size. Extract each entry through a counting stream (ZipArchive::getStream + fread loop) and abort once cumulative written bytes pass max_uncompressed_size, leaving nothing on disk; or check on-disk bytes incrementally during extraction. If the pre-pass stays, treat the declared-size sum as advisory and add the streamed byte counter as the real enforcement. max_files and max_depth remain effective.

Czego dotyczy

Kliknij technologię, aby zobaczyć wszystkie dotyczące jej podatności.

PlatformaPaczkaPodatne wersjePoprawka w wersji
Paczka Composer getgrav/grav >= 2.0.1, < 2.0.2 2.0.2

Odnośniki

Ocena CVSS 6.5/10
Wektor CVSS
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Słabość (CWE)
-
Platforma
Composer
Paczka
getgrav/grav
Ujawniono
17.09.2026
Aktualizacja
11.10.2026 10:22

Źródła i licencje

OSV / GitHub Advisory Database - GHSA-8h9x-89f2-m7x3 - CC BY 4.0

Historia podatności: getgrav/grav

Wszystkie opisane podatności tej paczki (Paczka Composer), od najnowszej. Widać, czy to jednorazowa wpadka, czy paczka, której trzeba pilnować.

Wszystkie (99) w archiwum
Wszystkich wpisów
99
Pierwsza → ostatnia
11.2019 09.2026
Bez poprawki
6
Wykorzystywana w atakach
0

Rozkład istotności

  • Krytyczna 7
  • Wysoka 47
  • Średnia 41
  • Niska 4

Ujawnienia w latach

  1. 2019: 1
  2. 2020: 1
  3. 2021: 4
  4. 2022: 10
  5. 2023: 5
  6. 2024: 8
  7. 2025: 23
  8. 2026: 47
Istotność:
  1. Wysoka · 8.8 CVE-2026-72819 < 2.0.13 2.0.13
  2. Grav: Decompression-bomb size cap bypassed by forged ZIP size in ZipArchiver/Installer ten wpis
    Średnia · 6.5 CVE-2026-61449 >= 2.0.1, < 2.0.2 2.0.2
  3. Wysoka CVE-2026-53653 >= 2.0.0-beta.1, < 2.0.0-rc.8, < 1.7.53 2.0.0-rc.8, 1.7.53
  4. Wysoka · 8.9 CVE-2026-42611 < 2.0.0-beta.2 2.0.0-beta.2
  5. Wysoka · 8.5 CVE-2026-42612 < 2.0.0-beta.2 2.0.0-beta.2
  6. Krytyczna · 9.4 CVE-2026-42613 < 2.0.0-beta.2 2.0.0-beta.2
  7. Krytyczna · 9.1 CVE-2025-66844 <= 1.7.49.5 brak poprawki
  8. Wysoka CVE-2025-66298 < 1.8.0-beta.27 1.8.0-beta.27
  9. Wysoka CVE-2025-66294 < 1.8.0-beta.27 1.8.0-beta.27
  10. Wysoka · 8.5 CVE-2025-66300 < 1.8.0-beta.27 1.8.0-beta.27
  11. Wysoka · 8.8 CVE-2025-66299 < 1.8.0-beta.27 1.8.0-beta.27
  12. Wysoka · 8.5 CVE-2024-34082 < 1.7.46 1.7.46
  13. Wysoka · 8.8 CVE-2024-28119 < 1.7.45 1.7.45
  14. Wysoka · 8.8 CVE-2024-28118 < 1.7.45 1.7.45
  15. Wysoka · 8.8 CVE-2024-28117 < 1.7.45 1.7.45
  16. Wysoka · 8.8 CVE-2024-27921 < 1.7.45 1.7.45
  17. Wysoka · 8.8 CVE-2024-27923 < 1.7.43 1.7.43
  18. Wysoka · 7.2 CVE-2023-37897 < 1.7.42.2 1.7.42.2
  19. Wysoka · 7.2 CVE-2023-34448 < 1.7.42 1.7.42
  20. Wysoka · 7.2 CVE-2023-34252 < 1.7.42 1.7.42
  21. Krytyczna · 9.1 CVE-2023-34251 < 1.7.42 1.7.42
  22. Wysoka · 7.2 CVE-2022-2073 < 1.7.34 1.7.34
  23. Wysoka · 8.1 CVE-2020-29555 >= 1.7.0-beta.1, <= 1.7.0-rc.17, < 1.6.30 1.6.30
  24. Wysoka · 8.8 CVE-2020-29553 >= 1.7.0-beta.1, <= 1.7.0-rc.17, < 1.6.30 1.6.30
  25. Wysoka · 7.1 CVE-2022-0970 < 1.7.31 1.7.31
  26. Wysoka · 8.8 CVE-2021-3924 <= 1.7.24 brak poprawki
  27. Wysoka · 8.4 CVE-2021-29440 < 1.7.11 1.7.11

Dowiedz się, które podatności dotyczą Twojej aplikacji

Po podłączeniu integracji DockRay i włączeniu raportowania oprogramowania DockRay porównuje zgłoszone wersje komponentów ze znanymi podatnościami i powiadamia o potwierdzonych dopasowaniach. Zakres zależy od obsługiwanej technologii i dostępnych biuletynów.

Podłącz swoją aplikację
Newsletter DockRay

Bezpieczeństwo aplikacji w Twojej skrzynce

Najważniejsze podatności, konkretne zalecenia i praktyczne wskazówki dla Twoich aplikacji. Wybierz technologie i śledź to, co ma znaczenie dla Twojego projektu.

  • Codzienne zestawienie nowych podatności, także krytycznych.
  • Powiadomienia o ważnych aktualizacjach.
  • Praktyczne porady o bezpieczeństwie i monitoringu aplikacji.

Pozostaw puste, aby otrzymywać informacje o wszystkich technologiach.

Zapis jest bezpłatny. Wypiszesz się jednym kliknięciem w wiadomości.