{"id":"CVE-2023-23626","aliases":["CVE-2023-23626","GHSA-2h6c-j3gf-xp9r","GO-2023-1558"],"related":[],"kind":"vulnerability","state":"published","title":"Denial of service when feeding malformed size arguments in go-bitfield","summary":"go-bitfield is a simple bitfield package for the go language aiming to be more performant that the standard library. When feeding untrusted user input into the size parameter of `NewBitfield` and `FromBytes` functions, an attacker can trigger `panic`s. This happen when the `size` is a not a multiple of `8` or is negative. There were already a note in the `NewBitfield` documentation, however known users of this package are subject to this issue. Users are advised to upgrade. Users unable to upgrade should ensure that `size` is a multiple of 8 before calling `NewBitfield` or `FromBytes`.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"go-bitfield is a simple bitfield package for the go language aiming to be more performant that the standard library. When feeding untrusted user input into the size parameter of `NewBitfield` and `FromBytes` functions, an attacker can trigger `panic`s. This happen when the `size` is a not a multiple of `8` or is negative. There were already a note in the `NewBitfield` documentation, however known users of this package are subject to this issue. Users are advised to upgrade. Users unable to upgrade should ensure that `size` is a multiple of 8 before calling `NewBitfield` or `FromBytes`.","source":"cvelist"},{"lang":"en","text":"### Impact\nWhen feeding untrusted user input into the size parameter of `NewBitfield` and `FromBytes` functions, an attacker can trigger `panic`s.\n\nThis happen when the `size` is a not a multiple of `8` or is negative.\nThere were already a note in the `NewBitfield` documentation:\n> ```\n> Panics if size is not a multiple of 8.\n> ````\n\nBut it incomplete and missing from `FromBytes`'s documentation.\n\nThis has been replaced by returning an `(Bitfield, error)` and returning a non nil error if the size is wrong.\n\n### Patches\n- https://github.com/ipfs/go-bitfield/commit/5e1d256fe043fc4163343ccca83862c69c52e579\n\n### Workarounds\n- Ensure `size%8 == 0 && size >= 0` yourself before calling `NewBitfield` or `FromBytes`\n\n### References\n- https://github.com/ipfs/go-unixfs/security/advisories/GHSA-q264-w97q-q778","format":"markdown","source":"ghsa"},{"lang":"en","text":"When feeding untrusted user input into the size parameter of NewBitfield and FromBytes functions, an attacker can trigger panics.\n\nThis happens when the size is a not a multiple of 8 or is negative.\n\nA workaround is to ensure size%8 == 0 && size >= 0 yourself before calling NewBitfield or FromBytes.","format":"markdown","source":"go"}],"published":"2023-02-09T20:54:07.075Z","modified":"2026-09-10T03:49:51.750Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-754","CWE-1284"],"affected":[{"ranges":[{"version":"< 1.1.0","status":"affected"}],"vendor":"ipfs","product":"go-bitfield","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.0"}],"ecosystem":"Go","package":"github.com/ipfs/go-bitfield","purl":"pkg:golang/github.com/ipfs/go-bitfield","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"1.1.0"}],"ecosystem":"Go","package":"github.com/ipfs/go-bitfield","purl":"pkg:golang/github.com/ipfs/go-bitfield","source":"go"},{"ranges":[{"status":"affected","fixed":"1.1.0"}],"vendor":"protocol","product":"go-bitfield","cpe":"cpe:2.3:a:protocol:go-bitfield:*:*:*:*:*:go:*:*","source":"nvd"}],"references":[{"url":"https://github.com/ipfs/go-bitfield/security/advisories/GHSA-2h6c-j3gf-xp9r","tags":["advisory","exploit","patch","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://github.com/ipfs/go-bitfield/commit/5e1d256fe043fc4163343ccca83862c69c52e579","tags":["fix","patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2023-23626","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/ipfs/go-bitfield","tags":["package"],"sources":["ghsa"]},{"url":"https://pkg.go.dev/vuln/GO-2023-1558","tags":["web"],"sources":["ghsa"]}],"credits":["Jorropo"],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2025-03-10T21:01:02.599Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2023-23626","url":"https://www.cve.org/CVERecord?id=CVE-2023-23626","licence":"CVE Terms of Use","modified":"2025-03-10T21:14:05.485Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2h6c-j3gf-xp9r","url":"https://github.com/advisories/GHSA-2h6c-j3gf-xp9r","licence":"CC-BY-4.0","modified":"2026-09-10T03:49:51.750Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2023-1558","url":"https://pkg.go.dev/vuln/GO-2023-1558","licence":"CC-BY-4.0","modified":"2024-05-20T16:03:47.000Z"},{"source":"nvd","name":"NVD","id":"CVE-2023-23626","url":"https://nvd.nist.gov/vuln/detail/CVE-2023-23626","licence":"Public domain","modified":"2026-06-17T05:37:37.003Z"}],"updatedAt":"2026-11-25T22:58:21.911Z","epss":{"score":0.00919,"percentile":0.61306,"date":"2026-12-01T12:00:22.000Z"}}