CVE-2021-21405
JSON

5.9medium

BLS Signature "Malleability"

Severity
5.9medium CVSS:3.1 by GitHub_M
Exploit likelihood
0.98% (higher than 63% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4g52-pqcj-phvhGO-2022-0905

Description

Lotus is an Implementation of the Filecoin protocol written in Go. BLS signature validation in lotus uses blst library method VerifyCompressed. This method accepts signatures in 2 forms: "serialized", and "compressed", meaning that BLS signatures can be provided as either of 2 unique byte arrays. Lotus block validation functions perform a uniqueness check on provided blocks. Two blocks are considered distinct if the CIDs of their blockheader do not match. The CID method for blockheader includes the BlockSig of the block. The result of these issues is that it would be possible to punish miners for valid blocks, as there are two different valid block CIDs available for each block, even though this must be unique. By switching from the go based `blst` bindings over to the bindings in `filecoin-ffi`, the code paths now ensure that all signatures are compressed by size and the way they are deserialized. This happened in https://github.com/filecoin-project/lotus/pull/5393.

Affected

Product or packageVersionsReported by
filecoin-project lotus< 1.5.0CVE List
github.com/filecoin-project/lotus (Go)before 1.5.0GitHub Advisory Database, Go Vulnerability Database
filecoin lotusbefore 1.5.0NVD

All scores

GitHub_M5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
GitHub5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
NVD5.0medium CVSS:2.0AV:N/AC:L/Au:N/C:N/I:P/A:N

Classification

What each source says

CVE List

Lotus is an Implementation of the Filecoin protocol written in Go. BLS signature validation in lotus uses blst library method VerifyCompressed. This method accepts signatures in 2 forms: "serialized", and "compressed", meaning that BLS signatures can be provided as either of 2 unique byte arrays. Lotus block validation functions perform a uniqueness check on provided blocks. Two blocks are considered distinct if the CIDs of their blockheader do not match. The CID method for blockheader includes the BlockSig of the block. The result of these issues is that it would be possible to punish miners for valid blocks, as there are two different valid block CIDs available for each block, even though this must be unique. By switching from the go based `blst` bindings over to the bindings in `filecoin-ffi`, the code paths now ensure that all signatures are compressed by size and the way they are deserialized. This happened in https://github.com/filecoin-project/lotus/pull/5393.

GitHub Advisory Database
Impact
  1. BLS signature validation in lotus uses blst library method VerifyCompressed. This method accepts signatures in 2 forms - "serialized", and "compressed", meaning that BLS signatures can be provided as either of 2 unique byte arrays.
  2. Lotus block validation functions perform a uniqueness check on provided blocks. Two blocks are considered distinct if the CIDs of their blockheader do not match. The CID method for blockheader includes the BlockSig of the block.

The result of these issues is that it would be possible to punish miners for valid blocks, as there are two different valid block CIDs available for each block, even though this must be unique.

Patches

By switching from the go based blst bindings over to the bindings in filecoin-ffi, the code paths now ensure that all signatures are compressed by size and the way they are deserialized. This happened in https://github.com/filecoin-project/lotus/pull/5393

References
Go Vulnerability Database

BLS Signature "Malleability" in github.com/filecoin-project/lotus

NVD (es)

Lotus es una implementación del protocolo Filecoin escrito en Go.&#xa0;La validación de la firma BLS en lotus utiliza el método de biblioteca blst VerifyCompressed.&#xa0;Este método acepta firmas en 2 formas: "serialized" y "compressed", lo que significa que las firmas BLS se pueden proporcionar como cualquiera de las 2 matrices de bytes únicas.&#xa0;Las funciones de validación de bloques de Lotus realizan una verificación de unicidad en los bloques proporcionados.&#xa0;Dos bloques se consideran distintos si los CID de su encabezado de bloque no coinciden.&#xa0;El método CID para blockheader incluye el BlockSig del bloque.&#xa0;El resultado de estos problemas es que sería posible castigar a los mineros por bloques válidos, ya que hay dos CID de bloque válidos diferentes disponibles para cada bloque, aunque este debe ser único.&#xa0;Al cambiar de los enlaces `blst` basados ??en go a los enlaces en `filecoin-ffi`,&#xa0;las rutas de código ahora garantizan que todas las firmas estén comprimidas por tamaño y la forma en que se deserializan.&#xa0;Esto ocurrió en https://github.com/filecoin-project/lotus/pull/5393

References

Sources

SourceRecordLicence
CVE ListCVE-2021-21405 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-4g52-pqcj-phvh changed 2026-07-08CC-BY-4.0
Go Vulnerability DatabaseGO-2022-0905 changed 2026-03-03CC-BY-4.0
NVDCVE-2021-21405 changed 2026-06-17Public domain