---
id: CVE-2026-129501
title: Double free during DOM XML serialization
summary: >-
  Double free during DOM XML serialization.


  The XML serializer of Dom\XMLDocument and Dom\HTMLDocument can share ownership
  of a generated namespace prefix between the namespace-prefix maps of an
  element and a descendant, so the prefix is …
severity: medium
cvss: 6.3
cvssVector: 'CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N'
cvssSource: cna
cwe:
  - CWE-415
  - CWE-416
vendor: PHP Group
product: PHP
affected:
  - PHP >= 8.4.0 < 8.4.28
  - PHP >= 8.5.0 < 8.5.13
ssvc:
  exploitation: none
  automatable: 'no'
  technicalImpact: partial
  timestamp: '2026-11-19T16:24:19.346750Z'
published: '2026-11-19'
updated: '2026-11-19'
sourceUpdated: '2026-11-19T16:52:45.140Z'
source: CVEORG
sourceUrl: 'https://www.cve.org/CVERecord?id=CVE-2026-129501'
references:
  - url: 'https://github.com/php/php-src/security/advisories/GHSA-x8r7-mg3g-74hg'
tags:
  - cve.org
ingestedAt: '2026-11-19T14:53:19.823Z'
epss: 0.0065
epssPercentile: 0.5211
---

## Overview

Double free during DOM XML serialization.

The XML serializer of Dom\XMLDocument and Dom\HTMLDocument can share ownership of a generated namespace prefix between the namespace-prefix maps of an element and a descendant, so the prefix is used after being freed and then freed a second time. The document does not need to be malformed. An application that parses attacker-controlled XML or HTML with these classes and serializes it with saveXml() can be crashed, and repeated requests can cause denial of service. Code execution has not been demonstrated.

This issue affects PHP versions 8.4.* before 8.4.28 and 8.5.* before 8.5.13.

## Affected

- `PHP >= 8.4.0 < 8.4.28`
- `PHP >= 8.5.0 < 8.5.13`

## Remediation

Refer to the linked advisories for vendor-supplied fixes and affected version ranges.
