# CVE-2026-58399: @acastellon/auth has an authentication bypass via spoofable headers in validateToken()

> An unauthenticated attacker can bypass token validation in @acastellon/auth by spoofing auth-user and Host headers, gaining unauthorized access to protected microservices.

- **Severity:** High 8.7 (`CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:N/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 1 Jul 2026
- **Updated:** 2 Jul 2026
- **Also known as:** GHSA-gfj5-979r-92pw

## What is CVE-2026-58399?

CVE-2026-58399 is a high-severity authentication bypass vulnerability in antonio-castellon module-auth, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

@acastellon/auth is an authentication control system for microservices. Versions prior to 2.3.0 appear to allow an unauthenticated authentication bypass in validateToken() through spoofable auth-user and Host request headers. The validateToken middleware contains a service-to-service bypass for auth-user: service-brother when req.get('host').startsWith(getHostName()). Both values involved in the check can be influenced by an unauthenticated HTTP client: auth-user is a request header, and Host is also client-controlled. As a result, a remote unauthenticated attacker can send a request with crafted headers and bypass token validation before the normal legacy/JWT/OIDC validation logic runs. A fix has been implemented in v2.3.0.

Weakness: CWE-287 (Improper Authentication)

## Which versions are affected by CVE-2026-58399?

2 open source packages ship an affected version, including @acastellon/auth.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `@acastellon/auth` | npm | All versions | 2.3.0 |
| `@acastellon/auth` | npm | All versions | 2.3.0 |

## How do I fix CVE-2026-58399?

Upgrade @acastellon/auth to 2.3.0 or later.

## Is CVE-2026-58399 being exploited?

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

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-58399 and fix it if it is affected.

What it is: CVE-2026-58399 is a high-severity authentication bypass vulnerability in antonio-castellon module-auth, published on 1 Jul 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2026-58399 in the wild and no public exploit code.

Affected packages and fixed versions:
- @acastellon/auth (npm): affected all versions; fixed in 2.3.0
- @acastellon/auth (npm): affected all versions; fixed in 2.3.0

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-2026-58399/ (Markdown: https://insights.sbomify.com/CVE-2026-58399/index.md)
```

## Sources

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

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