der: ASN.1 REAL (f64) decoder panics on short binary-encoding value (index out of bounds)
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
- 68/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- rust
- Área
- cryptography, security
Línea de trabajo
Empieza en der/src/asn1/real.rs, en la implementación de DecodeValue para f64, y sigue la rama de codificación binaria descrita en el informe. Comprueba cómo se maneja un valor de un byte, como 0x80, y luego ejecuta las pruebas pertinentes del decodificador DER REAL. El trabajo estará terminado cuando el contenido corto mal formado devuelva un error en lugar de provocar un pánico; el informe no indica ningún archivo de prueba concreto.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Note: this was originally privately disclosed by @tonghuaroot as GHSA-27m6-7r55-vwr2. I am posting it publicly because it's in an off-by-default obscure feature that no one uses, and because we continue to receive duplicate LLM-generated reports about it.
The ASN.1 REAL decoder in the der crate (impl DecodeValue for f64, der/src/asn1/real.rs) validates only a minimum on the value content
length (header.length() == Length::ZERO) and then, for the binary-encoding branch, reads fixed byte offsets (bytes[1], and bytes[2] for the
two-octet exponent form) out of the attacker-controlled value content without confirming the content is long enough to hold the exponent field.A DER REAL value whose content is the single byte 0x80 reaches bytes[1] on a length-1 slice and triggers an index out of bounds panic
instead of returning Err. Any code that calls f64::from_der / f64::decode (or decodes a struct containing an f64) on untrusted bytes.
I will further add that accepting this feature at all was likely a mistake given the security/crypto-oriented nature of this library. It should probably be removed entirely in the next breaking release.
- Lenguaje dominante
- Rust
- Estrellas
- 341
- Forks
- 193
- Merge medio
- 1 d 15 h
- PR fusionados (30 d)
- 21
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 RustCrypto/formats
-
IssuingDistributionPoint has the wrong AssociatedOid (id-pe-subjectInfoAccess)Posiblemente ocupada @eyusd la tomó hace 73 días. Abierto
Dificultad 1/5 1-3 horas Aptitud para principiantes 86/100
RustCrypto/formats#2389 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
RustCrypto/formats#2366 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
RustCrypto/formats#2471 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
RustCrypto/formats#2430 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
RustCrypto/formats#2428 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de RustCrypto/formats
Issues similares
-
area:config area:security bug good first issue platform:linux platform:windows priority:medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
rtk-ai/rtk#4651 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
documentation P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
vllm-project/agentic-api#463 ·
Los mantenedores suelen responder en 2 días
-
bug good first issue priority:high
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Konfirm-xyz/konfirm-contracts#163 ·
Los mantenedores suelen responder en 1 día
-
GL backend reports vendor id 0 for AMD GPUs on Windows (GL_VENDOR is "ATI Technologies Inc.")Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día