# GHSA-88q6-jcjg-hvmw: jose-swift has JWT Signature Verification Bypass via None Algorithm

> Unauthenticated attackers can forge JWT tokens using the 'none' algorithm to bypass signature verification, enabling user impersonation and privilege escalation.

- **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:** 9 Jan 2026

## What is GHSA-88q6-jcjg-hvmw?

GHSA-88q6-jcjg-hvmw is an authentication bypass vulnerability in github.com/beatt83/jose-swift, published on 9 Jan 2026. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

### Summary
An authentication bypass vulnerability allows any unauthenticated attacker to forge arbitrary JWT tokens by setting "alg": "none" in the token header. The library's verification functions immediately return `true` for such tokens without performing any cryptographic verification, enabling complete impersonation of any user and privilege escalation.

### Details
  The vulnerability exists in Sources/JSONWebSignature/JWS+Verify.swift at lines 34-37:

```
  public func verify<Key>(key: Key?) throws -> Bool {
      guard SigningAlgorithm.none != protectedHeader.algorithm else {
          return true  // <-- Vulnerability: returns true without verification
      }
```
  When the JWT header contains "alg": "none", the verify() method returns true immediately without:
  1. Checking if the signature is empty or present
  2. Validating the token against any key
  3. Requiring explicit opt-in from the caller
  

 The SigningAlgorithm enum in Sources/JSONWebAlgorithms/Signatures/SigningAlgorithm.swift:72 explicitly includes case none = "none" as a valid algorithm.

  All verification methods are affected:
  - JWS.verify(key:) - Instance method
  - JWS.verify(jwsString:payload:key:) - Static method
  - JWT.verify(jwtString:senderKey:) - High-level API

### PoC

  1. Create a forged JWT with modified claims:
  // Forged header with alg:none
  let header = #"{"alg":"none","typ":"JWT"}"#

  // Attacker's payload with escalated privileges
  let payload = #"{"sub":"user123","admin":true}"#

  // Base64URL encode and concatenate with empty signature
  let forgedToken = base64url(header) + "." + base64url(payload) + "."
  // Result: eyJhbGciOiJub25lIiwidHlwIjoiSldUIn0.eyJzdWIiOiJ1c2VyMTIzIiwiYWRtaW4iOnRydWV9.

  2. Verify the forged token passes verification:
  let jws = try JWS(jwsString: forgedToken)
  let isValid = try jws.verify(key: legitimateSecretKey)  // Returns TRUE

### Impact

  This is an authentication bypass vulnerability.   Who is impacted: Any application using jose-swift for JWT verification is vulnerable. An attacker can:

  - Forge identity: Create tokens claiming to be any user
  - Escalate privileges: Add admin/superuser claims to gain unauthorized access
  - Bypass authentication entirely: Access protected resources without valid credentials
  - Modify any claim: Change expiration, audience, issuer, or any custom claims

  The attack requires no knowledge of the signing key and works against all signature algorithms (HS256, RS256, ES256, etc.) since the attacker simply bypasses signature verification entirely.

### Credits
Reported by Louis Nyffenegger - https://pentesterlab.com/

## Which versions are affected by GHSA-88q6-jcjg-hvmw?

2 open source packages ship an affected version, including github.com/beatt83/jose-swift.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `github.com/beatt83/jose-swift` | SwiftURL | All versions | 6.0.2 |
| `github.com/beatt83/jose-swift` | SwiftURL | All versions | 6.0.2 |

## How do I fix GHSA-88q6-jcjg-hvmw?

Upgrade github.com/beatt83/jose-swift to 6.0.2 or later.

## Is GHSA-88q6-jcjg-hvmw being exploited?

There is no known exploitation of GHSA-88q6-jcjg-hvmw in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-88q6-jcjg-hvmw and fix it if it is affected.

What it is: GHSA-88q6-jcjg-hvmw is an authentication bypass vulnerability in github.com/beatt83/jose-swift, published on 9 Jan 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 GHSA-88q6-jcjg-hvmw in the wild and no public exploit code.

Affected packages and fixed versions:
- github.com/beatt83/jose-swift (SwiftURL): affected all versions; fixed in 6.0.2
- github.com/beatt83/jose-swift (SwiftURL): affected all versions; fixed in 6.0.2

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-88q6-jcjg-hvmw/ (Markdown: https://insights.sbomify.com/GHSA-88q6-jcjg-hvmw/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-88q6-jcjg-hvmw

---
From sbomify Insights: https://insights.sbomify.com/GHSA-88q6-jcjg-hvmw/
Summaries are generated and may contain mistakes; the official description above is the record.
