Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-m33r-qmcv-p97q

Опубликовано: 07 мая 2026
Источник: github
Github: Не прошло ревью
CVSS4: 6.3

Описание

SoapServer session-persisted object use-after-free via SOAP header fault

SOAP_PERSISTENCE_SESSION allows to persist the SOAP handler object between requests using the session storage. Normally the object is immediately released after SoapServer::handle(), unless this setting is specified. This differentiation happens with the service->soap_class.persistence != SOAP_PERSISTENCE_SESSION check. soap.c fails to account for this flag in two places:

https://github.com/php/php-src/blob/0d9ff00394d9447992bb66ccb1cef3edf70576bd/ext/soap/soap.c#L1595

https://github.com/php/php-src/blob/0d9ff00394d9447992bb66ccb1cef3edf70576bd/ext/soap/soap.c#L1600

Both of them are failure cases when a handler function for a header node either returned false or threw an exception. When the session is written, the freed object will be read and written to the session storage, resulting in a use-after-free. Normally, a SOAP server will only handle one SOAP request per PHP request, so it's unlikely that the attacker will be able to control the freed memory segment, though it is not impossible.

The following example demonstrates the use-after-free.

class SoapSrv { public function return() { return new SoapFault('Server', 'denied'); } public function hello() { return 'ok'; } } session_start(); $srv = new SoapServer(null, ['uri' => 'urn:a']); $srv->setClass('SoapSrv'); $srv->setPersistence(SOAP_PERSISTENCE_SESSION); $srv->handle(<<<XML <?xml version="1.0"?> <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:a="urn:a"> <soap:Header> <a:return/> </soap:Header> <soap:Body> <a:hello/> </soap:Body> </soap:Envelope> XML);

Пакеты

Наименование

php

php
Затронутые версииВерсия исправления

>=8.2.0, <8.2.31

8.2.31

Наименование

php

php
Затронутые версииВерсия исправления

>=8.3.0, <8.3.31

8.3.31

Наименование

php

php
Затронутые версииВерсия исправления

>=8.4.0, <8.4.21

8.4.21

Наименование

php

php
Затронутые версииВерсия исправления

>=8.5.0, <8.5.6

8.5.6

EPSS

Процентиль: 23%
0.00302
Низкий

6.3 Medium

CVSS4

Связанные уязвимости

CVSS3: 9.8
ubuntu
3 месяца назад

In PHP versions 8.2.* before 8.2.31, 8.3.* before 8.3.31, 8.4.* before 8.4.21, and 8.5.* before 8.5.6, when SoapServer is configured with SOAP_PERSISTENCE_SESSION, the handler object is persisted across requests via session storage. However, in the case SOAP requests results in an error, the persistance is handled incorrectly, resulting in freeing the object while keeping a pointer to it, which may lead to use-after-free. This may lead to memory corruption, information disclosure, or process crashes, with confidentiality, integrity, and availability impact on the vulnerable system.

CVSS3: 5.6
redhat
3 месяца назад

In PHP versions 8.2.* before 8.2.31, 8.3.* before 8.3.31, 8.4.* before 8.4.21, and 8.5.* before 8.5.6, when SoapServer is configured with SOAP_PERSISTENCE_SESSION, the handler object is persisted across requests via session storage. However, in the case SOAP requests results in an error, the persistance is handled incorrectly, resulting in freeing the object while keeping a pointer to it, which may lead to use-after-free. This may lead to memory corruption, information disclosure, or process crashes, with confidentiality, integrity, and availability impact on the vulnerable system.

CVSS3: 9.8
nvd
3 месяца назад

In PHP versions 8.2.* before 8.2.31, 8.3.* before 8.3.31, 8.4.* before 8.4.21, and 8.5.* before 8.5.6, when SoapServer is configured with SOAP_PERSISTENCE_SESSION, the handler object is persisted across requests via session storage. However, in the case SOAP requests results in an error, the persistance is handled incorrectly, resulting in freeing the object while keeping a pointer to it, which may lead to use-after-free. This may lead to memory corruption, information disclosure, or process crashes, with confidentiality, integrity, and availability impact on the vulnerable system.

msrc
3 месяца назад

SoapServer session-persisted object use-after-free via SOAP header fault

CVSS3: 9.8
debian
3 месяца назад

In PHP versions 8.2.* before 8.2.31, 8.3.* before 8.3.31, 8.4.* before ...

EPSS

Процентиль: 23%
0.00302
Низкий

6.3 Medium

CVSS4