{
  "schema_version": "1.4.0",
  "id": "GHSA-4g52-pqcj-phvh",
  "modified": "2021-05-20T20:51:00Z",
  "published": "2021-05-21T16:23:43Z",
  "aliases": [
    "CVE-2021-21405"
  ],
  "summary": "BLS Signature \"Malleability\"",
  "details": "### Impact\n\n1. 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.\n2. 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.\n\nThe 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.\n\n### Patches\n\nBy 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.\nThis happened in https://github.com/filecoin-project/lotus/pull/5393\n\n\n### References\n\n- Original POC: https://gist.github.com/wadeAlexC/2490d522e81a796af9efcad1686e6754",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Go",
        "name": "github.com/filecoin-project/lotus"
      },
      "ranges": [
        {
          "type": "ECOSYSTEM",
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "1.5.0"
            }
          ]
        }
      ]
    }
  ],
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/filecoin-project/lotus/security/advisories/GHSA-4g52-pqcj-phvh"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-21405"
    },
    {
      "type": "WEB",
      "url": "https://github.com/filecoin-project/lotus/pull/5393"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/wadeAlexC/2490d522e81a796af9efcad1686e6754"
    }
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-347"
    ],
    "severity": "MODERATE",
    "github_reviewed": true,
    "github_reviewed_at": "2021-05-20T20:51:00Z",
    "nvd_published_at": "2021-04-15T22:15:00Z"
  }
}