fix(auth0-express): tolerate a missing body parser in backchannel logout - #27
Closed
frederikprijck wants to merge 1 commit into
Closed
fix(auth0-express): tolerate a missing body parser in backchannel logout#27frederikprijck wants to merge 1 commit into
frederikprijck wants to merge 1 commit into
Conversation
frederikprijck
marked this pull request as draft
July 9, 2026 18:26
Read req.body?.logout_token so a request that reaches the handler without a body parser mounted (req.body undefined) hits the intended 400 missing-logout_token path instead of throwing a TypeError, which would otherwise surface as a 500. SECURITY: SDK-9 — fail-safe hardening (CWE-248).
frederikprijck
force-pushed
the
fix/sdk-9-fail-safe-nits
branch
from
August 25, 2026 12:39
ec7923e to
a55928f
Compare
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 backchannel-logout handler read
req.body.logout_tokendirectly. If the handler is reached without a body parser mounted,req.bodyisundefinedand that access throws aTypeError, surfacing as a 500 instead of the intended 400 missing-logout_tokenresponse.This reads
req.body?.logout_tokenso the missing-body case falls through to the existing 400 path.Changes
backchannel-logout-handler.ts:req.body.logout_token→req.body?.logout_tokenbackchannel-logout-handler.spec.ts: regression test asserting a 400 (not 500) when no body parser is mounted. Verified to fail without the fix.Context
This PR was originally the combined SDK-9 fail-safe PR. It has been split: the
require-authhalf (independent of the SDK-4 work) now lives in #44 againstmain. This PR is now scoped to the backchannel-logout fail-safe fix only and stays based onfix/sdk-4-sanitize-handler-errors(#26), since it touches the same handler.