# CVE-2024-50341: Security::login does not take into account custom user_checker in symfony/security-bundle

> Attackers can bypass custom user checks during programmatic login in Symfony, potentially gaining unauthorized access if custom checkers are configured.

- **Severity:** Low 3.1 (`CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:N/I:L/A:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 6 Nov 2024
- **Updated:** 7 Nov 2024
- **Also known as:** DEBIAN-CVE-2024-50341, GHSA-jxgr-3v7q-3w9v, UBUNTU-CVE-2024-50341

## What is CVE-2024-50341?

CVE-2024-50341 is a low-severity authentication bypass vulnerability in symfony, published on 6 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

symfony/security-bundle is a module for the Symphony PHP framework which provides a tight integration of the Security component into the Symfony full-stack framework. The custom `user_checker` defined on a firewall is not called when Login Programmaticaly with the `Security::login` method, leading to  unwanted login. As of versions 6.4.10, 7.0.10 and 7.1.3 the `Security::login` method now ensure to call the configured `user_checker`. All users are advised to upgrade. There are no known workarounds for this vulnerability.

Weakness: CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2024-50341?

12 open source packages ship an affected version, including symfony/security-bundle and symfony/symfony.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `symfony/security-bundle` | Packagist | From 6.2.0 | 6.4.10 |
| `symfony/security-bundle` | Packagist | From 6.2.0 | 6.4.10 |
| `symfony/security-bundle` | Packagist | From 7.0.0 | 7.0.10 |
| `symfony/security-bundle` | Packagist | From 7.0.0 | 7.0.10 |
| `symfony/security-bundle` | Packagist | From 7.1.0 | 7.1.3 |
| `symfony/security-bundle` | Packagist | From 7.1.0 | 7.1.3 |
| `symfony/symfony` | Packagist | From 6.2.0 | 6.4.10 |
| `symfony/symfony` | Packagist | From 6.2.0 | 6.4.10 |
| `symfony/symfony` | Packagist | From 7.0.0 | 7.0.10 |
| `symfony/symfony` | Packagist | From 7.0.0 | 7.0.10 |
| `symfony/symfony` | Packagist | From 7.1.0 | 7.1.3 |
| `symfony/symfony` | Packagist | From 7.1.0 | 7.1.3 |

## How do I fix CVE-2024-50341?

Upgrade symfony/security-bundle to a fixed version for your release line: 6.4.10, 7.0.10 or 7.1.3.

## Is CVE-2024-50341 being exploited?

There is no known exploitation of CVE-2024-50341 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2024-50341 and fix it if it is affected.

What it is: CVE-2024-50341 is a low-severity authentication bypass vulnerability in symfony, published on 6 Nov 2024. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2024-50341 in the wild and no public exploit code.

Affected packages and fixed versions:
- symfony/security-bundle (Packagist): affected from 6.2.0; fixed in 6.4.10
- symfony/security-bundle (Packagist): affected from 6.2.0; fixed in 6.4.10
- symfony/security-bundle (Packagist): affected from 7.0.0; fixed in 7.0.10
- symfony/security-bundle (Packagist): affected from 7.0.0; fixed in 7.0.10
- symfony/security-bundle (Packagist): affected from 7.1.0; fixed in 7.1.3
- symfony/security-bundle (Packagist): affected from 7.1.0; fixed in 7.1.3
- symfony/symfony (Packagist): affected from 6.2.0; fixed in 6.4.10
- symfony/symfony (Packagist): affected from 6.2.0; fixed in 6.4.10
- symfony/symfony (Packagist): affected from 7.0.0; fixed in 7.0.10
- symfony/symfony (Packagist): affected from 7.0.0; fixed in 7.0.10
- symfony/symfony (Packagist): affected from 7.1.0; fixed in 7.1.3
- symfony/symfony (Packagist): affected from 7.1.0; fixed in 7.1.3

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2024-50341/ (Markdown: https://insights.sbomify.com/CVE-2024-50341/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2024-50341
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2024-50341
- OSV: https://osv.dev/vulnerability/CVE-2024-50341

---
From sbomify Insights: https://insights.sbomify.com/CVE-2024-50341/
Summaries are generated and may contain mistakes; the official description above is the record.
