Skip to content

fix: fixes a possible panic during auth start if upsert operation fails#54323

Merged
tigrato merged 1 commit intomasterfrom
tigrato/fix-panic
Apr 25, 2025
Merged

fix: fixes a possible panic during auth start if upsert operation fails#54323
tigrato merged 1 commit intomasterfrom
tigrato/fix-panic

Conversation

@tigrato
Copy link
Copy Markdown
Contributor

@tigrato tigrato commented Apr 25, 2025

This PR addresses a potential panic that could occur due to a backend failure. In the event of such a failure, the user object is replaced with the result of the {Upsert|Create}User operation. If this operation also fails, both return nil, err, and since we attempted to access the user during error string construction, a nil pointer dereference could occur.

Changelog: Fixed a potential panic during Auth Server startup when the backend returns an error.

This PR fixes a possible panic caused by a failure caused by a backend
failure. If the failure occurs, we replaced the user object with the
result of the `{Upsert|Create}User` operation. If the operation fails,
both calls return `nil, err` and when building the error stream, we
accessed a nil user.

Signed-off-by: Tiago Silva <tiago.silva@goteleport.com>
@tigrato tigrato enabled auto-merge April 25, 2025 19:28
@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from kiosion April 25, 2025 19:35
@tigrato tigrato added this pull request to the merge queue Apr 25, 2025
Merged via the queue into master with commit 088c7da Apr 25, 2025
45 checks passed
@tigrato tigrato deleted the tigrato/fix-panic branch April 25, 2025 20:03
@backport-bot-workflows
Copy link
Copy Markdown
Contributor

@tigrato See the table below for backport results.

Branch Result
branch/v15 Create PR
branch/v16 Create PR
branch/v17 Create PR

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