-
Notifications
You must be signed in to change notification settings - Fork 1
JWT-SVID: aud claim missing from most issued tokens (spec violation) #42
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingsecuritySecurity issueSecurity issuespec-complianceDeviation from SPIFFE/WIMSE/JWT-SVID specsDeviation from SPIFFE/WIMSE/JWT-SVID specs
Description
Summary
The JWT-SVID specification (§3) requires that the `aud` claim MUST be present in every issued JWT-SVID. However, `internal/service/credential.go` lines 206–208 only sets `aud` when `IssueRequest.Audience` is non-empty — tokens issued without an explicit audience have no `aud` claim at all.
Location
`internal/service/credential.go` ~L206–208
if len(req.Audience) > 0 {
claims["aud"] = req.Audience
}Impact
Tokens issued without an explicit audience fail JWT-SVID validation in any conformant verifier (e.g. `authjwt` client package). This is a spec-level violation that breaks interoperability.
Fix
Default `aud` to the issuer URL when the caller does not specify an audience:
aud := req.Audience
if len(aud) == 0 {
aud = []string{issuerURL}
}
claims["aud"] = audReference
- JWT-SVID spec §3: "The `aud` claim MUST be present"
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingsecuritySecurity issueSecurity issuespec-complianceDeviation from SPIFFE/WIMSE/JWT-SVID specsDeviation from SPIFFE/WIMSE/JWT-SVID specs