Repository navigation
Quote the realm in BASIC and DIGEST challenges as a quoted-string - #1256
Open
arturobernalg wants to merge 1 commit into
Open
arturobernalg wants to merge 1 commit into
arturobernalg wants to merge 1 commit into
Conversation
The realm name was written between double quotes without escaping, so a realm containing DQUOTE or backslash produced an invalid quoted-string (RFC 9110, sections 2.2 and 5.6.4). With a realm such as CORP\Intranet a client that handles quoted-pair computed the DIGEST response with a different realm and authentication always failed.
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.
The realm name is written between double quotes in the
WWW-Authenticatechallenge without escaping, so a realm containing"or\produces an invalid quoted-string (RFC 9110, sections 2.2 and 5.6.4).This has a real effect with DIGEST. Recipients must treat a quoted-pair as the following octet, so for a realm
CORP\Intranetcurl usesCORPIntranetto compute the response and authentication always fails (401 with the right password). With the realm escaped, the same request returns 200 and a wrong password still returns 401. For BASIC, a realmTest "Realm"was sent asrealm="Test "Realm"".Adds
HttpParser.quote()next to the existingunquote(), escaping only DQUOTE and backslash, and uses it in both authenticators. The DIGEST read side already unquotes the realm from the Authorization header.TestAuthenticatorRealmName fails without the change. Checked on a running Tomcat with curl; the authenticator tests and the smoke profile pass.