# GHSA-jhmr-57cj-q6g9: Komari vulnerable to 2FA Authentication Bypass

> Attackers can bypass two-factor authentication by submitting any six-digit code, potentially gaining unauthorized access to Komari monitoring accounts.

- **Severity:** Not scored
- **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:** 12 Aug 2025
- **Also known as:** GO-2025-3873

## What is GHSA-jhmr-57cj-q6g9?

GHSA-jhmr-57cj-q6g9 is an authentication bypass vulnerability in github.com/komari-monitor/komari, published on 12 Aug 2025. Any signed-in user can exploit it over the network, with no action from the victim.

### Official description

### Summary

Logic error in 2FA verification condition allows bypass of two-factor authentication

### Details

https://github.com/komari-monitor/komari/blob/bd5a6934e1b79a12cf1e6a9bba5372d0e04f3abc/api/login.go#L55

There is no way for `Verify2Fa` to return an error **AND** true as `ok` at the same time, any codes are considered as valid.

### PoC

Use any 6 digits as 2FA code

### Impact

Bypass 2FA Authentication

## Which versions are affected by GHSA-jhmr-57cj-q6g9?

3 open source packages ship an affected version, including github.com/komari-monitor/komari.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/komari-monitor/komari` | Go | All versions | 0.0.0-20250809064056-cc3d54bff4c6 |
| `github.com/komari-monitor/komari` | Go | All versions | 0.0.0-20250809064056-cc3d54bff4c6 |
| `github.com/komari-monitor/komari` | Go | All versions | 0.0.0-20250809064056-cc3d54bff4c6 |

## How do I fix GHSA-jhmr-57cj-q6g9?

Upgrade github.com/komari-monitor/komari to 0.0.0-20250809064056-cc3d54bff4c6 or later.

## Is GHSA-jhmr-57cj-q6g9 being exploited?

There is no known exploitation of GHSA-jhmr-57cj-q6g9 in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-jhmr-57cj-q6g9 and fix it if it is affected.

What it is: GHSA-jhmr-57cj-q6g9 is an authentication bypass vulnerability in github.com/komari-monitor/komari, published on 12 Aug 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Exploitation: There is no known exploitation of GHSA-jhmr-57cj-q6g9 in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/komari-monitor/komari (Go): affected all versions; fixed in 0.0.0-20250809064056-cc3d54bff4c6
- github.com/komari-monitor/komari (Go): affected all versions; fixed in 0.0.0-20250809064056-cc3d54bff4c6
- github.com/komari-monitor/komari (Go): affected all versions; fixed in 0.0.0-20250809064056-cc3d54bff4c6

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-jhmr-57cj-q6g9/ (Markdown: https://insights.sbomify.com/GHSA-jhmr-57cj-q6g9/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-jhmr-57cj-q6g9

---
From sbomify Insights: https://insights.sbomify.com/GHSA-jhmr-57cj-q6g9/
Summaries are generated and may contain mistakes; the official description above is the record.
