ADVISORIES

GitHub Advisory Database

GHSA-g3rh-rrhp-jhh9

Symfony has an incorrect response from Validator when input ends with `\n`

Details

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.

Affected packages

EcosystemPackageAffected versions
Packagistsymfony/symfony
All versions before 5.4.43 (fixed in 5.4.43)
Packagistsymfony/symfony
From 6.0.0 before 6.4.11 (fixed in 6.4.11)
Packagistsymfony/symfony
From 7.0.0 before 7.1.4 (fixed in 7.1.4)
Packagistsymfony/validator
All versions before 5.4.43 (fixed in 5.4.43)
Packagistsymfony/validator
From 6.0.0 before 6.4.11 (fixed in 6.4.11)
Packagistsymfony/validator
From 7.0.0 before 7.1.4 (fixed in 7.1.4)

References