Skip to content

[v18] Prevent JWT-SVID timestamp claims being represented in scientific notation#61921

Merged
boxofrad merged 4 commits intobranch/v18from
bot/backport-61886-branch/v18
Dec 3, 2025
Merged

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

Conversation

@boxofrad
Copy link
Copy Markdown
Contributor

@boxofrad boxofrad commented Dec 2, 2025

Backport #61886 to branch/v18

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:23
…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 3, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 3, 2025
@boxofrad boxofrad added this pull request to the merge queue Dec 3, 2025
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Dec 3, 2025
@boxofrad boxofrad added this pull request to the merge queue Dec 3, 2025
Merged via the queue into branch/v18 with commit 2e90298 Dec 3, 2025
42 of 43 checks passed
@boxofrad boxofrad deleted the bot/backport-61886-branch/v18 branch December 3, 2025 13:03
@aadc-dev aadc-dev mentioned this pull request Dec 4, 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