llamaCVEVulnerability Intelligence
/
Advisory · GitHub · Packagist · php-standard-library/mime

GHSA-H47R-XW6C-XWWM

MIME multipart parser buffers the preamble and part header sections without limit, enabling memory exhaustion

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

Parche disponible
Descargar PNG JSON
CVSS 3.1
7.5
Alta
CVSS:3.1/AV:N/AC:L/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ón6.4.0
Exposición24 dDesde la divulgación, 27 oct 2026, 8:46 p. m.
Detección22 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, automatizable e impacto técnico parcial. Hay versiones corregidas disponibles.
Medio riesgo, cero excusas.Las PoC crecen rápido, como las llamas bebé.
Timeline

Ciclo de vida de la vulnerabilidad

Hoy
Divulgación
Publicada
Explotación
Remediación
Monitoreo
Detectada +1
28 oct 26
19 nov 26
21 nov 26
28 oct 26
3 nov 26
9 nov 26
15 nov 26
21 nov 26
FechaFaseEventoDetalle
Divulgación Publicada GHSA-H47R-XW6C-XWWM divulgada · CVSS 7.5 (GitHub)
Monitoreo Detectada Ingresó al índice
Monitoreo Verificada Última verificación contra las fuentes
Resumen
Descripción del advisory
Texto original · GitHub · en inglés

Impact

`Psl\MIME\MultiPart\Parser` streams part bodies to spool handles and enforces its `maxParts` and `maxPartSize` limits, but two other sections of the input were read into memory without any limit:

  • Preamble. To find the first boundary delimiter, `parse()` appended every chunk it read to a buffer and searched the whole buffer again after each 8 KiB read. The preamble before the first delimiter (RFC 2046 section 5.1.1) has no size limit and is chosen by the sender, so a body with a huge preamble, or with no boundary at all, was read into memory in full, and then copied again, before parsing started. The repeated search made the CPU cost grow with the square of the preamble size.
  • Part header sections. The header section of each part was buffered until a blank line ended it, with no limit and with the same repeated search. A part whose headers never end made the parser read the rest of the input into memory. Part headers that used LF line endings had the same effect even on well-formed input, because the parser first searched the whole remaining input for a CRLF blank line.

An attacker who can submit a multipart body to an application that parses it with `MultiPart\Parser`, for example a `multipart/form-data` request body or a multipart email, can make the process allocate memory in proportion to the size of the body, and spend CPU time in proportion to its square, whatever `maxParts` and `maxPartSize` are set to. Once the process exceeds PHP's `memory_limit`, it ends with a fatal error, together with every other request it was serving. Applications that cap the size of the body before it reaches the parser limit the memory to that cap, but a cap sized for large uploads still lets a single request exhaust memory. The attacker needs no privileges beyond whatever the application requires to submit a body.

PSL does not call the parser itself; applications that call it on untrusted input are affected.

Patches

Fixed in 6.4.0 https://github.com/php-standard-library/php-standard-library/releases/tag/6.4.0.

  • The preamble is skipped in constant memory: between reads, only the last `strlen($delimiter) - 1` bytes are kept, which is enough to find a delimiter split across two reads.
  • The new constructor argument `$maxHeaderSize` (16 KiB by default, 0 for unlimited) bounds each part header section. A larger section fails with `MultiPartException` after at most the limit plus one read chunk has been buffered. Part header sections larger than 16 KiB are now rejected unless a larger limit is passed.
  • A part header section ends at its first blank line, whether CRLF or LF, instead of the rest of the input being searched for a CRLF blank line first.
  • The `maxParts` limit is enforced as soon as a delimiter shows that another part follows, before any of the extra part is read.

Workarounds

Bound the input before the parser sees it: wrap the handle in `Psl\IO\BoundedReadHandle` with the largest body you accept, or enforce a request body size limit in the web server or proxy in front of the application. This caps memory use at that limit but does not restore a per-section limit, so keep it as small as the application allows.

References

  • RFC 2046 section 5.1.1 (multipart common syntax, preamble and body part headers)
  • RFC 7578 (`multipart/form-data`)
  • https://github.com/php-standard-library/php-standard-library/releases/tag/6.4.0
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:L
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
10.0/ 10Muy alto
Vector 10.0 (muy fácil) · sin evidencia de explotación.
Versiones

Rangos afectados

Afectada Corregida
php-standard-library/mime · php-standard-library/php-standard-library≥ 6.2.0 < 6.4.0
6.2.0
6.4.0
Remediación

Estado del parche por paquete

Paquete / productoEstadoCorregida enDesde divulgaciónÚltima versión
Packagistphp-standard-library/mime
Corregida 6.4.0 — —
Packagistphp-standard-library/php-standard-library
Corregida 6.4.0 — —
Versiones corregidas6.4.0
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-standard-library/php-standard-library/security/advisories/GHSA-h47r-xw6c-xwwm

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