jose-swift has JWT Signature Verification Bypass via None Algorithm
Date: 2026-01
Affected: swift/github.com/beatt83/jose-swift
Attack vector: auth-bypass
Category: vulnerability-disclosure
Severity: High
CWE: CWE-327

### 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


Mitigations:

Architectural layers (MAESTRO):