Repository navigation
fix(trueforge): keep OIDC exchange failures out of the error redirect - #687
Merged
chiragjn merged 1 commit intoSep 28, 2026
Merged
Conversation
CaptainAni187
requested review from
bhaveshpatel640,
chiragjn,
debajyoti-truefoundry,
heerambavi1998,
sr07asthana and
thesujai
as code owners
September 10, 2026 19:14
🦋 Changeset detectedLatest commit: 5fe2690 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
CaptainAni187
force-pushed
the
fix-oidc-exchange-error-leak
branch
from
September 11, 2026 08:04
e501fb4 to
c8cffae
Compare
Contributor
Author
Contributor
Author
|
Hi @chiragjn, thanks again for merging #688 earlier. Whenever you have a moment, could you take a look at this one and #686? Both are small and CI is green:
Happy to rebase either if they've gone stale. |
chiragjn
force-pushed
the
fix-oidc-exchange-error-leak
branch
from
September 28, 2026 05:08
c8cffae to
6b91ea6
Compare
chiragjn
approved these changes
Sep 28, 2026
The callback handler curates the IdP error branch carefully, then reflects the raw exception from the token exchange into /?error=. openid-client embeds the token-endpoint response and issuer host in that message, so internal detail reached the browser's address bar, where it persists in history and support screenshots. An attacker who induces a failing exchange also controlled that text on a trusted origin. Use the same generic login_failed reason as the neighbouring paths; the full error already goes to the logger above via extractErrorLogFields. Fixes #422
chiragjn
force-pushed
the
fix-oidc-exchange-error-leak
branch
from
September 28, 2026 05:28
6b91ea6 to
5fe2690
Compare
chiragjn
enabled auto-merge (squash)
September 28, 2026 05:29
4 of 5 tasks
Merged
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The callback handler is deliberate about the IdP error branch, then reflects the raw token-exchange exception into
/?error=. That message comes fromopenid-clientand embeds the token-endpoint response and issuer host, so internal detail ends up in the address bar, browser history and support screenshots. Since the state cookie is set by any unauthenticated/auth/loginvisit, an attacker who induces a failing exchange also controls that text on a trusted origin.Closes #422
Changes
login_failedreason as the neighbouring paths. Full detail already goes to the logger above viaextractErrorLogFields, so nothing is lost for debugging.How was this tested?
jest --config jest.unit.config.cjs tests/unit/apis/auth.test.ts— 24 pass. Reverting the one line fails the new case, and the received value shows what was leaking:Checklist
format:checkpasses repo-wide and eslint is clean on the touched files; ran the package's unit suite rather than the fullpnpm test. Repo-widelint:cihas 55 pre-existing errors, all inpackages/frontend/*andDropdownMenu.tsx, none in files this PR touches.env.example— not applicableChangeset included. On process: CONTRIBUTING asks for approval first, and all six
help wantedissues are assigned or already have PRs, so there was nothing approved to pick up. Close this if you'd rather it went through the queue.Note
Medium Risk
Changes OIDC login failure UX and closes an information-disclosure vector in redirect URLs; behavior is narrow but touches security-sensitive auth callback handling.
Overview
When the OIDC callback’s authorization-code exchange fails, users are no longer redirected with the raw
openid-clientexception text in?error=. That message could embed the token endpoint response and issuer host, which showed up in the URL, browser history, and screenshots on a trusted origin.Failures now always redirect with the generic
login_failedreason, matching state mismatch, missing code, and other non–IdP-error paths. Full error detail remains in the server log via the existingextractErrorLogFieldslogging.A unit test stubs a failing token POST and asserts the redirect is
/?error=login_failedwithout the issuer host or upstream OAuth error codes.Reviewed by Cursor Bugbot for commit 5fe2690. Bugbot is set up for automated code reviews on this repo. Configure here.