ListBasicType.serialize accepts values longer than the list limit
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- backend
Línea de trabajo
Encuentra ListBasicType y su método serialize, y luego compara sus comprobaciones de longitud con las rutas existentes de fromJson y deserialize. Comprueba VectorBasicType en las cercanías, tal como sugiere el issue, y ejecuta las pruebas pertinentes. El trabajo estará terminado cuando la serialización de una lista que exceda el límite rechace la entrada con un error que indique su longitud y el límite, y también se haya comprobado el comportamiento de los vectores.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
ListBasicType.serialize does not enforce the list limit. A value longer than the limit is written as SSZ bytes without error. The matching fromJson and deserialize paths already reject the same over-length input.
Repro on @chainsafe/[email protected] (current master):
import { ListBasicType, UintNumberType } from "@chainsafe/ssz";
const list = new ListBasicType(new UintNumberType(1), 4);
list.serialize([1, 2, 3, 4, 5]);
// -> Uint8Array [1, 2, 3, 4, 5] (no throw)
list.fromJson([1, 2, 3, 4, 5]);
// throws: Invalid list length 5 over limit 4
list.deserialize(list.serialize([1, 2, 3, 4, 5]));
// throws: Invalid list length 5 over limit 4
Expected behavior
serialize should reject a value whose length is greater than the list limit, with the same class of error as fromJson / deserialize (Invalid list length N over limit M).
Actual behavior
serialize emits SSZ bytes for the over-length value. Round-tripping through deserialize then fails, and fromJson already refuses the same input.
Additional context
Same asymmetry class as serialize-time validation gaps elsewhere in the package (e.g. uint range checks on serialize). VectorBasicType with the wrong fixed length also needs a quick check in the same area if it is not already covered.
- Lenguaje dominante
- TypeScript
- Estrellas
- 62
- Forks
- 30
- Merge medio
- 4 h 37 min
- PR fusionados (30 d)
- 3
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin 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 ChainSafe/ssz
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
BitList deserialization with reuseBytes: true mutates the input bufferPosiblemente ocupada @yinbowen-dc la tomó hace 9 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
ChainSafe/ssz#559 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bitlist maxSize off by one and inconsistent progressive list default limitsPosiblemente ocupada @yinbowen-dc la tomó hace 10 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ChainSafe/ssz#548 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
SSZ Union Deserialization Vulnerable to Trailing Data for Certain VariantsPosiblemente ocupada @shadowzzed la tomó hace 80 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
UintNumberType.serialize silently wraps out-of-range values (negative, NaN, overflow)Posiblemente ocupada @kutluhaneth46 la tomó hace 2 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 25/100
Los mantenedores suelen responder en 1 día
Todos los issues de ChainSafe/ssz
Issues similares
-
Release utils decode git output chunk by chunk, so a multi-byte character can turn into U+FFFDPosiblemente ocupada @goranai la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 2 días
-
Task retarget keeps the old host in task scope and adds the new host in a form that matches nothingPosiblemente ocupada @chaitanya0305 la tomó hoy. Abiertobug P2
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
BaaRai/ARTEX#652 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
compiler-explorer/compiler-explorer#9710 ·
Los mantenedores suelen responder en 1 día
-
test(web): RevealArtwork's warm tests flake on CI because a 0 ms idle timeout means no deadlineAbiertobug effort:S P3
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
nightscout/nocturne#4556 ·
Los mantenedores suelen responder en 1 día
-
sumHorizontal, maxHorizontal, minHorizontal, allHorizontal, anyHorizontal, struct and argSortBy treat strings as literals instead of column namesPosiblemente ocupada @tomaionescu la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
pola-rs/nodejs-polars#486 ·
Los mantenedores suelen responder en 1 día