# GHSA-g2qj-pmxm-9f8f: User enumeration in authentication mechanisms

> Attackers can enumerate valid usernames via distinct error messages or timing differences in Symfony authentication, requiring a patch to standardize responses.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 17 May 2021

## What is GHSA-g2qj-pmxm-9f8f?

GHSA-g2qj-pmxm-9f8f is a vulnerability in symfony/security-http, published on 17 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Description
-----------

The ability to enumerate users was possible without relevant permissions due to different exception messages depending on whether the user existed or not. It was also possible to enumerate users by using a timing attack, by comparing time elapsed when authenticating an existing user and authenticating a non-existing user.

Resolution
----------

We now ensure that 403s are returned whether the user exists or not if the password is invalid or if the user does not exist.

The patch for this issue is available [here](https://github.com/symfony/symfony/commit/2a581d22cc621b33d5464ed65c4bc2057f72f011) for branch 3.4.

Credits
-------

I would like to thank James Isaac and Mathias Brodala for reporting the issue and Robin Chalas for fixing the issue.

## Which versions are affected by GHSA-g2qj-pmxm-9f8f?

4 open source packages ship an affected version, including symfony/security-http and symfony/symfony.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `symfony/security-http` | Packagist | From 5.1.0 | 5.2.8 |
| `symfony/security-http` | Packagist | From 5.1.0 | 5.2.8 |
| `symfony/symfony` | Packagist | From 5.1.0 | 5.2.8 |
| `symfony/symfony` | Packagist | From 5.1.0 | 5.2.8 |

## How do I fix GHSA-g2qj-pmxm-9f8f?

Upgrade symfony/security-http to 5.2.8 or later.

## Is GHSA-g2qj-pmxm-9f8f being exploited?

There is no known exploitation of GHSA-g2qj-pmxm-9f8f in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-g2qj-pmxm-9f8f and fix it if it is affected.

What it is: GHSA-g2qj-pmxm-9f8f is a vulnerability in symfony/security-http, published on 17 May 2021. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-g2qj-pmxm-9f8f in the wild and no public exploit code.

Affected packages and fixed versions:
- symfony/security-http (Packagist): affected from 5.1.0; fixed in 5.2.8
- symfony/security-http (Packagist): affected from 5.1.0; fixed in 5.2.8
- symfony/symfony (Packagist): affected from 5.1.0; fixed in 5.2.8
- symfony/symfony (Packagist): affected from 5.1.0; fixed in 5.2.8

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/GHSA-g2qj-pmxm-9f8f/ (Markdown: https://insights.sbomify.com/GHSA-g2qj-pmxm-9f8f/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-g2qj-pmxm-9f8f

---
From sbomify Insights: https://insights.sbomify.com/GHSA-g2qj-pmxm-9f8f/
Summaries are generated and may contain mistakes; the official description above is the record.
