# GHSA-2frx-j9hj-6c65: User enumeration in authentication mechanisms

> Attackers can enumerate valid usernames via distinct error messages, enabling targeted attacks against the LexikJWTAuthenticationBundle.

- **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-2frx-j9hj-6c65?

GHSA-2frx-j9hj-6c65 is a vulnerability in lexik/jwt-authentication-bundle, 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. 

Resolution
----------

We now ensure that a generic message is 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/lexik/LexikJWTAuthenticationBundle/commit/a175d6dab968d93e96a3e4f80c495435f71d5eb7) for branch 2.10.x and 2.x.

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-2frx-j9hj-6c65?

4 open source packages ship an affected version, including lexik/jwt-authentication-bundle.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `lexik/jwt-authentication-bundle` | Packagist | All versions | 2.10.7 |
| `lexik/jwt-authentication-bundle` | Packagist | All versions | 2.10.7 |
| `lexik/jwt-authentication-bundle` | Packagist | From 2.11.0 | 2.11.3 |
| `lexik/jwt-authentication-bundle` | Packagist | From 2.11.0 | 2.11.3 |

## How do I fix GHSA-2frx-j9hj-6c65?

Upgrade lexik/jwt-authentication-bundle to a fixed version for your release line: 2.10.7 or 2.11.3.

## Is GHSA-2frx-j9hj-6c65 being exploited?

There is no known exploitation of GHSA-2frx-j9hj-6c65 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-2frx-j9hj-6c65 and fix it if it is affected.

What it is: GHSA-2frx-j9hj-6c65 is a vulnerability in lexik/jwt-authentication-bundle, 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-2frx-j9hj-6c65 in the wild and no public exploit code.

Affected packages and fixed versions:
- lexik/jwt-authentication-bundle (Packagist): affected all versions; fixed in 2.10.7
- lexik/jwt-authentication-bundle (Packagist): affected all versions; fixed in 2.10.7
- lexik/jwt-authentication-bundle (Packagist): affected from 2.11.0; fixed in 2.11.3
- lexik/jwt-authentication-bundle (Packagist): affected from 2.11.0; fixed in 2.11.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/GHSA-2frx-j9hj-6c65/ (Markdown: https://insights.sbomify.com/GHSA-2frx-j9hj-6c65/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-2frx-j9hj-6c65

---
From sbomify Insights: https://insights.sbomify.com/GHSA-2frx-j9hj-6c65/
Summaries are generated and may contain mistakes; the official description above is the record.
