Subject emailAddress isn't checked against rfc822Name constraints when the leaf has no subjectAltName
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 22/100
Línea de trabajo
Start with check_name_constraints in src/subject_name/mod.rs, which checks SAN entries and the subject directory name but never extracts the subject emailAddress when there is no subjectAltName. Run the linked gist repro (cargo run) to see forbidden_no_san accepted while forbidden_email_san is rejected, and compare with the openssl verify control. Done means the no-SAN case is rejected under a permitted rfc822Name constraint, with the RFC 5280 section 4.2.1.10 behaviour and related issues #445 and #70 taken into account.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Re-filing from GHSA-hc65-xjvf-77jj as asked.
rustls-webpki 0.103.16 (and main) accepts a certificate whose subject emailAddress is outside its issuer's permitted rfc822Name subtree when the leaf has no subjectAltName. If the same email is in a SAN, the constraint fails closed as expected.
As @ctz pointed out on the advisory, webpki has no API for asserting email identities and ignores names in the subject. So the impact is narrow: webpki accepts a constrained chain that isn't valid under its constraints. It only matters if something else extracts the subject email from a chain webpki has validated.
Details
RFC 5280 section 4.2.1.10 applies rfc822Name constraints to an email address in the subject DN when there's no subjectAltName. check_name_constraints checks the SAN entries plus the subject as a directory name. A directory name doesn't match an rfc822Name subtree, so it's skipped, and the subject emailAddress is never pulled out.
An email SAN under an email constraint hits the unsupported-name path and is rejected. The no-SAN subject email never reaches that path.
Related: #445 (email constraint support) and #70 (RFC 5280 deviations).
Repro
https://gist.github.com/DicksonWu654/7cb644c9485e48118a11899867fee090
cargo run builds against rustls-webpki = "=0.103.16" with the certs embedded. A root signs an intermediate with a critical permitted rfc822Name subtree for allowed.test, which signs three client-auth leaves:
allowed_no_san: accepted
forbidden_no_san: accepted
forbidden_email_san: rejected (NameConstraintViolation)
forbidden_no_san has emailAddress = [email protected] in the subject and no SAN. openssl verify on the same chain fails with error 47 (permitted subtree violation). The README has a one-liner for that.
Possible fix
When the leaf has no subjectAltName, treat subject emailAddress attributes like SAN emails for constraint purposes. With the current fail-closed handling, that means rejecting the chain when an email constraint is present.
I used AI tools (OpenAI Codex and Anthropic Claude) to find this, build the test and draft the report. The test and the OpenSSL control were re-run against 0.103.16 before the original report, and the cited code was checked against source.
- Lenguaje dominante
- Rust
- Estrellas
- 167
- Forks
- 112
- Merge medio
- 4 h 28 min
- PR fusionados (30 d)
- 4
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de rustls/webpki
-
Path building re-parses every intermediate on each budgeted call (unbudgeted CPU cost)Posiblemente ocupada @batmnnn la tomó hace 23 días. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
-
Improve error message when denying subject name due to wildcard in public suffixQuizá libre de nuevo @ctz la tomó hace 80 días y no hay ningún pull request abierto. Abierto
-
Consider all candidate CRLsQuizá libre de nuevo @cpu la tomó hace 86 días y no hay ningún pull request abierto. Abierto
-
Add opt-in support for ignoring URI name constraintsPosiblemente ocupada @djc la tomó hace 135 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
Todos los issues de rustls/webpki
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
pop-os/cosmic-settings#2296 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
jonathanong/no-mistakes#3431 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Ephemeral-AI-Lab/layerfs#689 ·
Los mantenedores suelen responder en 1 día