CVE-2024-50343: Symfony Validator Regex Vulnerability Leading to Incorrect Input Handling

symfony/symfony Updated 02 Oct 2025

Summary

06/11/2024
Yes i
Low
3.1

CVE-2024-50343: Symfony has an incorrect response from Validator when input ends with \n. Affects symfony/symfony across 3 version ranges.

< 5.4.43 >= 6.0.0, < 6.4.11 >= 7.0.0, < 7.1.4

Fixed in 5.4.43, 6.4.11 or 7.1.4, depending on the release line you run. How to fix ↓

Also tracked for

The same CVE-2024-50343 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Sponsored MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Symfony is a robust PHP framework widely used for building web applications. It provides a set of reusable components and a structured way to develop applications. One of its key features is the Validator component, which ensures that data adheres to specified rules. However, a recent vulnerability has been identified that affects the Validator's handling of inputs ending with a newline character, potentially leading to incorrect validation results.

Vulnerability Detail

The vulnerability arises from the Validator's configuration with regular expressions that do not account for inputs ending with a newline character ('\n'). This oversight allows malicious users to manipulate input validation by exploiting the '$' metacharacter, which can lead to unexpected behavior in applications relying on the Validator for data integrity. The ramifications include the potential for unauthorized data acceptance, which could compromise application security and functionality.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 5.4.43 5.4.43
    composer require symfony/symfony:5.4.43
  • >= 6.0.0, < 6.4.11 6.4.11
    composer require symfony/symfony:6.4.11
  • >= 7.0.0, < 7.1.4 7.1.4
    composer require symfony/symfony:7.1.4

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Workaround

As a temporary workaround, ensure that your regular expressions in the Validator do not allow inputs that end with a newline character. This can be done by modifying the regex patterns to explicitly exclude such cases until the package is updated.

Conclusion

In summary, CVE-2024-50343 is a significant vulnerability in the Symfony Validator component that can lead to incorrect input validation. It is crucial to update to the patched versions to mitigate this risk. Additionally, using tools like Vulert can help monitor for such vulnerabilities in your applications.

See every vulnerability recorded for symfony/symfony →

Share this vulnerability

FAQ

CVE-2024-50343 is a vulnerability in the Symfony Validator component that allows incorrect validation of inputs ending with a newline character.

This vulnerability can lead to unauthorized data being accepted by your application, potentially compromising its security and functionality.

The affected versions include Symfony 5.4.0 to 5.4.42, 6.0.0 to 6.4.10, and 7.0.0 to 7.1.3.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

Vulert is a tool that monitors and alerts in real-time for open-source vulnerabilities in your software by analyzing the composer.lock file.

Related vulnerabilities

Recent vulnerabilities recorded for symfony/symfony.

How To Fix

Fixed versions by release line

The minimum fixed version depends on the release line you run.

  • < 5.4.43 5.4.43
    composer require symfony/symfony:5.4.43
  • >= 6.0.0, < 6.4.11 6.4.11
    composer require symfony/symfony:6.4.11
  • >= 7.0.0, < 7.1.4 7.1.4
    composer require symfony/symfony:7.1.4

Tip — Not sure which release line you're on? Vulert can find the fix for the version you are using. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback