CVE-2024-50343
JSON

3.1low

Incorrect response from Validator when input ends with `\n` in symfony/validator

Severity
3.1low CVSS:3.1 by GitHub_M
Exploit likelihood
0.46% (higher than 41% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-g3rh-rrhp-jhh9

Description

symfony/validator is a module for the Symphony PHP framework which provides tools to validate values. It is possible to trick a `Validator` configured with a regular expression using the `$` metacharacters, with an input ending with `\n`. Symfony as of versions 5.4.43, 6.4.11, and 7.1.4 now uses the `D` regex modifier to match the entire input. Users are advised to upgrade. There are no known workarounds for this vulnerability.

Affected

Product or packageVersionsReported by
symfony symfony< 5.4.43, >= 6.0.0, < 6.4.11, >= 7.0.0, < 7.1.4CVE List
symfony/symfony (Packagist)before 5.4.43, from 6.0.0 before 6.4.11, from 7.0.0 before 7.1.4GitHub Advisory Database
symfony/validator (Packagist)before 5.4.43, from 6.0.0 before 6.4.11, from 7.0.0 before 7.1.4GitHub Advisory Database

All scores

GitHub_M3.1low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N
GitHub3.1low CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:N/A:N
GitHublow CVSS:4.0CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

Classification

CWE-20

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

symfony/validator is a module for the Symphony PHP framework which provides tools to validate values. It is possible to trick a `Validator` configured with a regular expression using the `$` metacharacters, with an input ending with `\n`. Symfony as of versions 5.4.43, 6.4.11, and 7.1.4 now uses the `D` regex modifier to match the entire input. Users are advised to upgrade. There are no known workarounds for this vulnerability.

GitHub Advisory Database
Description

It is possible to trick a Validator configured with a regular expression using the $ metacharacters, with an input ending with \n.

Resolution

Symfony now uses the D regex modifier to match the entire input.

The patch for this issue is available here for branch 5.4.

Credits

We would like to thank Offscript for reporting the issue and Alexandre Daubois for providing the fix.

NVD (es)

symfony/validator es un módulo para el framework PHP Symphony que proporciona herramientas para validar valores. Es posible engañar a un `Validator` configurado con una expresión regular utilizando los metacaracteres `$`, con una entrada que termina en `\n`. Symfony a partir de las versiones 5.4.43, 6.4.11 y 7.1.4 ahora utiliza el modificador de expresión regular `D` para que coincida con toda la entrada. Se recomienda a los usuarios que actualicen. No se conocen workarounds para esta vulnerabilidad.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-50343 changed 2025-11-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-g3rh-rrhp-jhh9 changed 2025-11-03CC-BY-4.0
NVDCVE-2024-50343 changed 2026-06-17Public domain