arturobernalg opened a new pull request, #1256:
URL: https://github.com/apache/tomcat/pull/1256

   The realm name is written between double quotes in the `WWW-Authenticate` 
challenge 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\Intranet` curl uses `CORPIntranet` to 
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 realm `Test "Realm"` was sent as 
`realm="Test "Realm""`.
   
   Adds `HttpParser.quote()` next to the existing `unquote()`, 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.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to