Skip to content

fix(sdk): the Rust SDK reads at most 64 KiB of a back-channel logout request - #567

Merged
PiquelChips merged 1 commit into
mainfrom
fix/549-logout-body-limit
Nov 21, 2026
Merged

PiquelChips merged 1 commit into
mainfrom
fix/549-logout-body-limit

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

An app using the Rust SDK read a back-channel logout request whole, up to axum's default 2 MB form limit, before refusing the token. The TypeScript SDK stops at 64 KiB, since a logout token is at most 16 KiB.

The Rust route now stops at 64 KiB too, with a DefaultBodyLimit on that route only. A larger request gets the same answer as a malformed one, and the same answer the TypeScript SDK gives: 400 with {"error":"invalid_request"} and Cache-Control: no-store. The handler never sees it.

The limit is MAX_LOGOUT_REQUEST_BYTES in sourceorigin_common::protocol::constants (4 * MAX_TOKEN_BYTES), which both SDKs now read: the TypeScript SDK's own MAX_LOGOUT_REQUEST copy is gone, and protocol.ts is regenerated.

backchannel_logout_refuses_large_requests posts a valid token padded to 1 MB (400, handler not called), then a normal one (200). Without the fix it fails, because the padded request gets a 200.

Closes #549

Note

Written by Claude Opus 5.5 in Claude Code and reviewed by GPT 6.1 Sol (via T3 Code)

@PiquelChips PiquelChips added bug Something isn't working sdk Rust and TypeScript SDKs labels Nov 20, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in sourceorigin.dev Nov 20, 2026
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 208b078a-bb51-41b8-9446-ce58afc84225
Commits

Reviewing files that changed from the base of the PR and between f675d8d and bb02126.

Files selected for processing: 6

  • crates/auth-sdk/src/axum/login/mod.rs
  • crates/auth-sdk/src/axum/tests/backchannel.rs
  • crates/common/src/protocol/constants.rs
  • docs/dev/architecture/sdk.md
  • packages/auth/src/login.ts
  • packages/auth/src/protocol.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips marked this pull request as ready for review November 20, 2026 07:33
@PiquelChips
PiquelChips marked this pull request as draft November 21, 2026 14:00
…request

The Rust SDK's back-channel logout route read up to axum's default 2 MB
form, while the TypeScript SDK stops at 64 KiB: a logout token is at most
16 KiB. The route now has a 64 KiB body limit, and a larger request is
answered like a malformed one, 400 with invalid_request.

Closes #549
@PiquelChips
PiquelChips force-pushed the fix/549-logout-body-limit branch from ad03d24 to bb02126 Compare November 21, 2026 14:05
@PiquelChips
PiquelChips marked this pull request as ready for review November 21, 2026 14:09
@PiquelChips
PiquelChips added this pull request to the merge queue Nov 21, 2026
Merged via the queue into main with commit a9d0c3e Nov 21, 2026
14 checks passed
@PiquelChips
PiquelChips deleted the fix/549-logout-body-limit branch November 21, 2026 14:47
@github-project-automation github-project-automation Bot moved this from Needs Triage to Done in sourceorigin.dev Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working sdk Rust and TypeScript SDKs

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

fix(sdk): the Rust SDK reads at most 64 KiB of a back-channel logout request

1 participant