[Eclipse Jetty] Digest authentication lossy encoding
# CVE Reservation Request
<!--
There's help in the Eclipse Foundation Project Handbook https://www.eclipse.org/projects/handbook/#vulnerability-cve
Note that this issue is configured (see the quick actions at the bottom) to be created as confidential.
Note that a vulnerability does not need to actually be resolved before it is reported and that these reports can be revised as needed (reopen the issue to request changes).
If you do not know how to fill certain fields, mark that in the comment and we will help you.
You can delete the comments (or not).
-->
The Eclipse Foundation is a [Common Vulnerabilities and Exposures](https://cve.mitre.org/) (CVE) Numbering Authority.
Creating this ticket initiates **reservation** of a CVE ID for the documented vulnerability. The reserved CVE ID will be posted in a comment below, and kept **confidential** until explicit publication request.
> [!note]
> To request CVE *publication*, please open a [CVE publication](https://gitlab.eclipse.org/security/cve-assignment/-/issues/new?issuable_template=CVE%20Publication%20Request) ticket.
Please fill in the fields below to draft the CVE record.
---
<!--
Required. Specify the project's name (e.g., "Eclipse Dash") and Eclipse Foundation ID, e.g., "technology.dash".
-->
## CVE record information
**Project name:** Eclipse Jetty
**Project id:** rt/jetty
<!--
Required (for publication). Specify the version range as precisely as possible, e.g., "[3.0, 3.5.1]" or "[3.0, 3.5.1)". Note that using the standard range notion, square brackets are inclusive (i.e., that version is included in the range), and round brakets are exclusive (the vulnerability affects all versions up to but not including the named version).
Multiple ranges can be provided.
-->
**Versions affected:** {versions}
```
org.eclipse.jetty.ee8:jetty-ee8-security
>=12.0.0, <=12.0.35
>=12.1.0, <=12.1.9
org.eclipse.jetty.ee9:jetty-ee9-security
>=12.0.0, <=12.0.35
>=12.1.0, <=12.1.9
org.eclipse.jetty:jetty-security
>= 9.4.0, <=9.4.62
>=10.0.0, <=10.0.30
>=11.0.0, <=11.0.30
>=12.0.0, <=12.0.35
>=12.1.0, <=12.1.9
```
<!--
Required (for publication). The Common Weakness Enumeration (CWE) code comes from here: https://cwe.mitre.org/, e.g., "CWE-93: Improper Neutralization of CRLF Sequences ('CRLF Injection')". Multiple codes can be provided.
-->
**Common Weakness Enumeration (CWE):**
- [CWE-173](https://cwe.mitre.org/data/definitions/173.html)
- [CWE-303](https://cwe.mitre.org/data/definitions/303.html)
<!--
Optional. The Common Attack Pattern Enumerations and Classifications (CAPEC) code comes from here: https://capec.mitre.org/, e.g., "CAPEC-63: Cross-Site Scripting (XSS)". Multiple codes can be provided.
-->
**Common Attack Pattern Enumerations and Classifications (CAPEC):**
- N/A
<!--
Optional. Provide a Common Vulnerability Scoring System (CVSS). Note that if you do not provide this, then some agencies (eg. NIST) will compute it on the project's behalf. Please be sure to include the CVSS version number, e.g., "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H".
There's help here: https://www.first.org/cvss/calculator/4.0
-->
**Common Vulnerability Scoring System:**
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N
<!--
Required (for publication). The summary should start with the name of the project, e.g., "Eclipse Vert.x", then a description of the affected versions, followed by a description of the problem. The summary should be concise. For example,
"In Eclipse Vert.x version 3.0 to 3.5.1, the HttpServer response
headers and HttpClient request headers do not filter carriage return and
line feed characters from the header value. This allow unfiltered values
to inject a new header in the client request or server response."
-->
**Summary:**
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.
<!--
Required (for publication). Include a link to the issue (e.g., GitHub Security Advisory) that's being used to track/resolve the issue. Other links that provide more information can be provided. For example, you may later publish the link to the fix commit.
-->
**Links:**
- https://github.com/jetty/jetty.project/security/advisories/GHSA-2fvj-hgj9-j2gr
<!--
Optional. Add the name or pseudonym of the person who has reported the issue.
-->
**Credits:**
[hrykx-zy](https://github.com/hrykx-zy)
<!-- Quick actions will configure the state of the issue. Leave these. -->
<!-- Keep this as the last line -->
issue