Skip to content

[v17] Prevent JWT-SVID timestamp claims being represented in scientific notation#61922

Merged
boxofrad merged 4 commits intobranch/v17from
bot/backport-61886-branch/v17
Dec 2, 2025
Merged

[v17] Prevent JWT-SVID timestamp claims being represented in scientific notation#61922
boxofrad merged 4 commits intobranch/v17from
bot/backport-61886-branch/v17

Conversation

@boxofrad
Copy link
Copy Markdown
Contributor

@boxofrad boxofrad commented Dec 2, 2025

Backport #61886 to branch/v17

changelog: Fixed a bug where JWT-SVID timestamp claims would be represented using scientific notation

boxofrad and others added 4 commits December 2, 2025 12:22
…ation

Fixes a bug where setting `extra_claims` in the WorkloadIdentity resource causes
the timestamp JWT-SVID claims (e.g. `exp` and `iat`) to be represented using
scientific notation, which less lenient parsers will reject.

Previously, we would round-trip the `jwt.Claims` through `json.Marshal` so that
we could get them as a `map[string]any` to which we could add the user's claims.
Unfortunately, this trick would unmarshal the `jwt.NumericDate` as a float64
which the marshaler will represent using scientific notation.

Now, we use a `map[string]any` from the start rather than the `jwt.Claims` which
preserves the correct types until we marshal the claims for real.

changelog: Fixed a bug where JWT-SVID timestamp claims would be represented using scientific notation
Co-authored-by: Marek Smoliński <marek@goteleport.com>
@boxofrad boxofrad added this pull request to the merge queue Dec 2, 2025
Merged via the queue into branch/v17 with commit 481f317 Dec 2, 2025
40 checks passed
@boxofrad boxofrad deleted the bot/backport-61886-branch/v17 branch December 2, 2025 14:04
@doggydogworld doggydogworld mentioned this pull request Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants