2025-12-27 19:27CVE-2025-14178php
PUBLISHED5.2CWE-787CWE-190

Heap buffer overflow in array_merge()

In PHP versions:8.1.* before 8.1.34, 8.2.* before 8.2.30, 8.3.* before 8.3.29, 8.4.* before 8.4.16, 8.5.* before 8.5.1, a heap buffer overflow occurs in array_merge() when the total element count of packed arrays exceeds 32-bit limits or HT_MAX_SIZE, due to an integer overflow in the precomputation of element counts using zend_hash_num_elements(). This may lead to memory corruption or crashes and affect the integrity and availability of the target server.

Problem type

Affected products

PHP Group

PHP

< 8.1.34 - AFFECTED

< 8.2.30 - AFFECTED

< 8.3.29 - AFFECTED

< 8.4.16 - AFFECTED

< 8.5.1 - AFFECTED

References

JSON source

https://cveawg.mitre.org/api/cve/CVE-2025-14178
Click to expand
{
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "cveMetadata": {
    "cveId": "CVE-2025-14178",
    "assignerOrgId": "dd77f84a-d19a-4638-8c3d-a322d820ed2b",
    "assignerShortName": "php",
    "dateUpdated": "2025-12-27T19:27:41.691Z",
    "dateReserved": "2025-12-06T06:25:31.535Z",
    "datePublished": "2025-12-27T19:27:41.691Z",
    "state": "PUBLISHED"
  },
  "containers": {
    "cna": {
      "providerMetadata": {
        "orgId": "dd77f84a-d19a-4638-8c3d-a322d820ed2b",
        "shortName": "php",
        "dateUpdated": "2025-12-27T19:27:41.691Z"
      },
      "datePublic": "2025-12-18T00:00:00.000Z",
      "title": "Heap buffer overflow in array_merge()",
      "descriptions": [
        {
          "lang": "en",
          "value": "In PHP versions:8.1.* before 8.1.34, 8.2.* before 8.2.30, 8.3.* before 8.3.29, 8.4.* before 8.4.16, 8.5.* before 8.5.1, a heap buffer overflow occurs in array_merge() when the total element count of packed arrays exceeds 32-bit limits or HT_MAX_SIZE, due to an integer overflow in the precomputation of element counts using zend_hash_num_elements(). This may lead to memory corruption or crashes and affect the integrity and availability of the target server.",
          "supportingMedia": [
            {
              "type": "text/html",
              "base64": false,
              "value": "<p>In PHP versions:8.1.* before 8.1.34, 8.2.* before 8.2.30, 8.3.* before 8.3.29, 8.4.* before 8.4.16, 8.5.* before 8.5.1, a heap buffer overflow occurs in array_merge() when the total element count of packed arrays exceeds 32-bit limits or HT_MAX_SIZE, due to an integer overflow in the precomputation of element counts using zend_hash_num_elements(). This may lead to memory corruption or crashes and affect the integrity and availability of the target server.</p>"
            }
          ]
        }
      ],
      "affected": [
        {
          "vendor": "PHP Group",
          "product": "PHP",
          "packageName": "php",
          "defaultStatus": "affected",
          "versions": [
            {
              "version": "8.1.*",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.1.34"
            },
            {
              "version": "8.2.*",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.2.30"
            },
            {
              "version": "8.3.*",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.3.29"
            },
            {
              "version": "8.4.*",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.4.16"
            },
            {
              "version": "8.5.*",
              "status": "affected",
              "versionType": "semver",
              "lessThan": "8.5.1"
            }
          ]
        }
      ],
      "problemTypes": [
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-787 Out-of-bounds Write",
              "cweId": "CWE-787",
              "type": "CWE"
            }
          ]
        },
        {
          "descriptions": [
            {
              "lang": "en",
              "description": "CWE-190 Integer Overflow or Wraparound",
              "cweId": "CWE-190",
              "type": "CWE"
            }
          ]
        }
      ],
      "references": [
        {
          "url": "https://github.com/php/php-src/security/advisories/GHSA-h96m-rvf9-jgm2"
        }
      ],
      "metrics": [
        {
          "format": "CVSS",
          "scenarios": [
            {
              "lang": "en",
              "value": "GENERAL"
            }
          ],
          "cvssV3_1": {
            "version": "3.1",
            "vectorString": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H",
            "attackVector": "NETWORK",
            "attackComplexity": "HIGH",
            "privilegesRequired": "NONE",
            "userInteraction": "NONE",
            "scope": "UNCHANGED",
            "confidentialityImpact": "NONE",
            "integrityImpact": "LOW",
            "availabilityImpact": "HIGH",
            "baseScore": 6.5,
            "baseSeverity": "MEDIUM"
          }
        }
      ],
      "credits": [
        {
          "lang": "en",
          "value": "Niels Dossche",
          "type": "reporter"
        }
      ]
    }
  }
}