oauth2: percent-encode '+' in token request body parameters#43693
Open
garimauttam wants to merge 3 commits intoenvoyproxy:mainfrom
Open
oauth2: percent-encode '+' in token request body parameters#43693garimauttam wants to merge 3 commits intoenvoyproxy:mainfrom
garimauttam wants to merge 3 commits intoenvoyproxy:mainfrom
Conversation
2eceec0 to
73530d2
Compare
Member
|
cc @zhaohuabing @wbpcode for a review. |
Member
|
Hi @garimauttam thanks for fixing this! Since the reserved character set appears in multiple places, would it make sense to define it as a constant and reuse it throughout? |
5ce7d5a to
3fc2517
Compare
Member
|
gently ping @zhaohuabing |
Member
|
Hi @garimauttam Could you please fix the format? https://github.com/envoyproxy/envoy/actions/runs/23315013831/job/67812067258 |
|
Hi @garimauttam are you still working on this? can i help get this merged? |
Signed-off-by: garima-uttam <garimauttam@ibm.com>
Signed-off-by: garima-uttam <garimauttam@ibm.com>
Signed-off-by: garima-uttam <garimauttam@ibm.com>
0bf23ab to
5163df4
Compare
Contributor
Author
@rubenceroni thanks. I’ve fixed the format failure. I’d really appreciate a quick review to help get this merged. |
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.
PercentEncoding::encodeinoauth_client.ccwas missing+from its reserved charset (":/=&?"). Inapplication/x-www-form-urlencoded, an unencoded+is interpreted as a space by the server — so OAuth2 credentials containing+(e.g. Azure AD / Entra ID client secrets) were silently mangled, resulting in401 AADSTS7000215: Invalid client secret.Why it matters
Base64-encoded secrets commonly contain
+. This caused silent, hard-to-debug auth failures with no indication the secret was being corrupted in transit.Change
":/=&?"→":/=&?+"across all 9PercentEncoding::encodecalls inasyncGetAccessTokenandasyncRefreshAccessTokenUrlEncodedBody,BasicAuth,TlsClientAuth) and all parameters (client_id,client_secret,redirect_uri,code_verifier,refresh_token)Tests
3 new unit tests in
oauth_test.ccassert+→%2Bforclient_secret,client_id, andrefresh_token.Fixes #43686