TypeScript verify rejects a signature without `alg`; the Rust verifier (#157) and draft §5.2 accept it

Abierto Apto para principiantes
#172 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
70/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
typescript

Línea de trabajo

El verificador de TypeScript rechaza alg faltante en packages/web-bot-auth/src/index.ts líneas 326–328. Lee ese bloque y la corrección de Rust en #157 para ver cómo recurrir al algoritmo de la clave. Hecho significa que una solicitud con los parámetros requeridos del draft y sin alg se verifica con éxito, coincidiendo con el verificador de Rust.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

What happens

A request signed with exactly the parameters the draft requires (created, expires, keyid, tag) and no alg is rejected by the TypeScript verifier.

  • [email protected]: "Required parameter alg is absent".
  • main (2c3eb0b, 27 October): "signed algorithm is missing or unsupported", from packages/web-bot-auth/src/index.ts lines 326–328.

What the draft says

draft-ietf-webbotauth-httpsig-protocol-01 §5.2 (published 29 October) lists created, expires, keyid and tag as the required signature parameters. alg is not on the list. RFC 9421 §3.1 lets a verifier take the algorithm from the key it resolved.

What the Rust verifier does

Since #157 (merged 19 October, fixing #153), the Rust verifier checks alg only when it is present and otherwise takes the algorithm from the key. This issue is the absent case, not the mismatch case #153 covered. So the two verifiers in this repository now disagree on the same request.

Reproduction

The interop/ folder of https://github.com/authecity/agent-identity-document signs with the draft's required set and verifies with both this library and my own verifier. It runs weekly in that repository's workflow. Everything else in the run agrees between the two verifiers, including the draft's Appendix E vectors, which all carry alg, so the suite does not otherwise exercise the absent case.

Question

Should the TypeScript path match the Rust one and take the algorithm from the resolved key when alg is absent? If alg is meant to be required for this profile, the draft's §5.2 would need to say so, and I would follow it.

Lenguaje dominante
Rust
Estrellas
182
Forks
49
Merge medio
1 d 20 min
PR fusionados (30 d)
19

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de cloudflare/web-bot-auth

Todos los issues de cloudflare/web-bot-auth

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.