Skip to content

fix: decode userState in parseState for code flow#1507

Open
earshinov wants to merge 1 commit into
manfredsteyer:masterfrom
earshinov:fix/decode-userstate-in-parsestate
Open

fix: decode userState in parseState for code flow#1507
earshinov wants to merge 1 commit into
manfredsteyer:masterfrom
earshinov:fix/decode-userstate-in-parsestate

Conversation

@earshinov

@earshinov earshinov commented Jul 10, 2026

Copy link
Copy Markdown

The library encodes userState when composing the OAuth state parameter, but parseState returned the extracted value without decoding it. In the authorization-code callback path, the query parser only decodes the returned state once, leaving userState still encoded.

Fixes #783, #1506

Worth noting: this was already fixed once in #61 (2017), which added decodeURIComponent(parts["state"]) on the return path. That decode was later dropped during the workspace rewrite. When nonce-packing + parseState were introduced afterwards the extracted userState was returned undecoded again.

The library encodes userState when composing the OAuth state parameter,
but parseState returned the extracted value without decoding it. In the
authorization-code callback path, the query parser only decodes the
returned state once, leaving userState still encoded.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Double URI encoding on additionnalState

1 participant