Digest authentication lossy encoding
Eclipse Foundation Eclipse Jetty - EE8 · Eclipse Foundation Eclipse Jetty - EE9 · Eclipse Foundation Eclipse Jetty
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| org.eclipse.jetty:jetty-security Maven |
|
|
Eclipse Foundation Eclipse Jetty - EE8 · Eclipse Foundation Eclipse Jetty - EE9 · Eclipse Foundation Eclipse Jetty
| Product | Affected | Fixed in |
|---|---|---|
| org.eclipse.jetty:jetty-security Maven |
|
|
12.0.3612.1.10| org.eclipse.jetty.ee8:jetty-ee8-security Maven |
|
|
| org.eclipse.jetty.ee9:jetty-ee9-security Maven |
|
|
In Eclipse Jetty, the Digest authentication server-side component uses ISO-8859-1 to encode the password as bytes.
This was done because the initial specification for HTTP did not specify explicitly a charset, and it was assumed to be ISO-8859-1 for historical reasons.
If the password contains characters that cannot be represented in ISO-8859-1, they are silently replaced by `?`. This happens with passwords that contain Chinese, Cyrillic or Greek characters, for example: `αβ123` converts to `??123`.
An attacker can send a request with a digest `Authorization` header crafted with a password made of only `?` characters; the server would match any password of the same length that contains non-ISO-8859-1 characters.
Recent HTTP Digest [RFC-7616](https://datatracker.ietf.org/doc/html/rfc7616) supports a `charset` parameters that defaults to UTF-8 that allows for correct encoding/decoding of passwords.
From the CVE record · eclipse
Eclipse Jetty's server-side Digest authentication replaces password characters outside ISO-8859-1 with `?`. A remote attacker can send a crafted Digest Authorization header to authenticate as a user whose password contains such characters, if the attacker supplies the matching replacement characters and password length. No prior authentication or user interaction is required.
Teams running Eclipse Jetty, Jetty EE8, or Jetty EE9 should check affected versions of their Maven security packages: jetty-security from 9.4.0.v20161208 to before 9.4.63, 10.0.0 to before 10.0.31, 11.0.0 to before 11.0.31, 12.0.0 to before 12.0.36, or 12.1.0 to before 12.1.10; and jetty-ee8-security or jetty-ee9-security from 12.0.0 to before 12.0.36 or 12.1.0 to before 12.1.10.