{"id":"CVE-2024-29903","aliases":["CVE-2024-29903","GHSA-95pr-fxf5-86gv","BIT-COSIGN-2024-29903","GO-2024-2719"],"related":["CGA-24jm-9gpv-m3hv"],"kind":"vulnerability","state":"published","title":"Cosign vulnerable to machine-wide denial of service via malicious artifacts","summary":"Cosign provides code signing and transparency for containers and binaries. Prior to version 2.2.4, maliciously-crafted software artifacts can cause denial of service of the machine running Cosign thereby impacting all services on the machine. The root cause is that Cosign creates slices based on the number of signatures, manifests or attestations in untrusted artifacts. As such, the untrusted artifact can control the amount of memory that Cosign allocates. The exact issue is Cosign allocates excessive memory on the lines that creates a slice of the same length as the manifests. Version 2.2.4 contains a patch for the vulnerability.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"Cosign provides code signing and transparency for containers and binaries. Prior to version 2.2.4, maliciously-crafted software artifacts can cause denial of service of the machine running Cosign thereby impacting all services on the machine. The root cause is that Cosign creates slices based on the number of signatures, manifests or attestations in untrusted artifacts. As such, the untrusted artifact can control the amount of memory that Cosign allocates. The exact issue is Cosign allocates excessive memory on the lines that creates a slice of the same length as the manifests. Version 2.2.4 contains a patch for the vulnerability.","source":"cvelist"},{"lang":"en","text":"Maliciously-crafted software artifacts can cause denial of service of the machine running Cosign, thereby impacting all services on the machine. The root cause is that Cosign creates slices based on the number of signatures, manifests or attestations in untrusted artifacts. As such, the untrusted artifact can control the amount of memory that Cosign allocates.  \n\nAs an example, these lines demonstrate the problem:\n\nhttps://github.com/sigstore/cosign/blob/286a98a4a99c1b2f32f84b0d560e324100312280/pkg/oci/remote/signatures.go#L56-L70 \n\nThis `Get()` method gets the manifest of the image, allocates a slice equal to the length of the layers in the manifest, loops through the layers and adds a new signature to the slice.\n\nThe exact issue is Cosign allocates excessive memory on the lines that creates a slice of the same length as the manifests. \n\n## Remediation\n\nUpdate to the latest version of Cosign, where the number of attestations, signatures and manifests has been limited to a reasonable value.\n\n## Cosign PoC\n\nIn the case of this API (also referenced above):\n\nhttps://github.com/sigstore/cosign/blob/286a98a4a99c1b2f32f84b0d560e324100312280/pkg/oci/remote/signatures.go#L56-L70\n\n… The first line can contain a length that is safe for the system and will not throw a runtime panic or be blocked by other safety mechanisms. For the sake of argument, let’s say that the length of `m, err := s.Manifest()` is the max allowed (by the machine without throwing OOM panics) manifests minus 1. When Cosign then allocates a new slice on this line: `signatures := make([]oci.Signature, 0, len(m.Layers))`, Cosign will allocate more memory than is available and the machine will be denied of service, causing Cosign and all other services on the machine to be unavailable.\n\nTo illustrate the issue here, we run a modified version of `TestSignedImageIndex()` in `pkg/oci/remote`:\n\nhttps://github.com/sigstore/cosign/blob/14795db16417579fac0c00c11e166868d7976b61/pkg/oci/remote/index_test.go#L31-L57\n\nHere, `wantLayers` is the number of manifests from these lines:\n\nhttps://github.com/sigstore/cosign/blob/286a98a4a99c1b2f32f84b0d560e324100312280/pkg/oci/remote/signatures.go#L56-L60\n\nTo test this, we want to make `wantLayers` high enough to not cause a memory on its own but still trigger the machine-wide OOM when a slice gets create with the same length. On my local machine, it would take hours to create a slice of layers that fulfils that criteria, so instead I modify the Cosign production code to reflect a long list of manifests:\n\n```golang\n// Get implements oci.Signatures\nfunc (s *sigs) Get() ([]oci.Signature, error) {\n        m, err := s.Manifest()\n        if err != nil {\n                return nil, err\n        }\n        // Here we imitate a long list of manifests\n        ms := make([]byte, 2600000000) // imitate a long list of manifests\n        signatures := make([]oci.Signature, 0, len(ms))\n        panic(\"Done\")\n        //signatures := make([]oci.Signature, 0, len(m.Layers))\n        for _, desc := range m.Layers {\n```\n\nWith this modified code, if we can cause an OOM without triggering the `panic(\"Done\")`, we have succeeded.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Cosign malicious artifacts can cause machine-wide DoS in github.com/sigstore/cosign","format":"markdown","source":"go"},{"lang":"es","text":"Cosign proporciona firma de código y transparencia para contenedores y binarios. Antes de la versión 2.2.4, los artefactos de software creados con fines malintencionados podían provocar la denegación de servicio de la máquina que ejecuta Cosign, lo que afectaba a todos los servicios de la máquina. La causa principal es que Cosign crea sectores basados en la cantidad de firmas, manifiestos o certificaciones en artefactos que no son de confianza. Como tal, el artefacto que no es de confianza puede controlar la cantidad de memoria que asigna Cosign. El problema exacto es que Cosign asigna memoria excesiva en las líneas, lo que crea un segmento de la misma longitud que los manifiestos. La versión 2.2.4 contiene un parche para la vulnerabilidad.","source":"nvd"}],"published":"2024-04-10T22:30:50.890Z","modified":"2026-09-10T03:50:00.260Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:H","score":4.2,"rating":"MEDIUM"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:H","score":4.2,"rating":"MEDIUM"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:H/PR:H/UI:R/S:U/C:N/I:N/A:H","score":4.2,"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"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"HIGH"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"< 2.2.4","status":"affected"}],"vendor":"sigstore","product":"cosign","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0","fixed":"2.2.4","status":"affected"}],"vendor":"sigstore","product":"cosign","cpe":"cpe:2.3:a:sigstore:cosign:-:*:*:*:*:*:*:*","source":"cvelist"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","lastAffected":"2.2.3"}],"ecosystem":"Go","package":"github.com/sigstore/cosign","purl":"pkg:golang/github.com/sigstore/cosign","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.2.4"}],"ecosystem":"Go","package":"github.com/sigstore/cosign/v2","purl":"pkg:golang/github.com/sigstore/cosign/v2","source":"ghsa"},{"ranges":[{"type":"semver","introduced":"0","status":"affected"}],"ecosystem":"Go","package":"github.com/sigstore/cosign","purl":"pkg:golang/github.com/sigstore/cosign","source":"go"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.2.4"}],"ecosystem":"Go","package":"github.com/sigstore/cosign/v2","purl":"pkg:golang/github.com/sigstore/cosign/v2","source":"go"},{"ranges":[{"status":"affected","fixed":"2.2.4"}],"vendor":"sigstore","product":"cosign","cpe":"cpe:2.3:a:sigstore:cosign:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"type":"semver","introduced":"0","status":"affected","fixed":"2.2.4"}],"ecosystem":"Bitnami","package":"cosign","purl":"pkg:bitnami/cosign","source":"bitnami"}],"references":[{"url":"https://github.com/sigstore/cosign/security/advisories/GHSA-95pr-fxf5-86gv","tags":["advisory","exploit","vendor-advisory","web","x-refsource-confirm","x-transferred"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://github.com/sigstore/cosign/commit/629f5f8fa672973503edde75f84dcd984637629e","tags":["fix","patch","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://github.com/sigstore/cosign/blob/14795db16417579fac0c00c11e166868d7976b61/pkg/cosign/verify.go#L948-L955","tags":["product","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://github.com/sigstore/cosign/blob/286a98a4a99c1b2f32f84b0d560e324100312280/pkg/oci/remote/signatures.go#L56-L70","tags":["product","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://github.com/sigstore/cosign/releases/tag/v2.2.4","tags":["article","release-notes","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2024-29903","tags":["advisory","web"],"sources":["ghsa","go","bitnami"]},{"url":"https://github.com/sigstore/cosign","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"no","technicalImpact":"partial","date":"2024-07-03T15:22:56.624Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-29903","url":"https://www.cve.org/CVERecord?id=CVE-2024-29903","licence":"CVE Terms of Use","modified":"2024-08-02T01:17:58.600Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-95pr-fxf5-86gv","url":"https://github.com/advisories/GHSA-95pr-fxf5-86gv","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:00.260Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2024-2719","url":"https://pkg.go.dev/vuln/GO-2024-2719","licence":"CC-BY-4.0","modified":"2026-02-04T02:35:06.535Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-29903","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-29903","licence":"Public domain","modified":"2026-06-17T07:23:20.263Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-COSIGN-2024-29903","url":"https://osv.dev/vulnerability/BIT-COSIGN-2024-29903","licence":"Apache-2.0","modified":"2026-09-08T08:46:05.154Z"}],"updatedAt":"2026-11-25T22:58:39.085Z","epss":{"score":0.00851,"percentile":0.59309,"date":"2026-12-01T12:00:22.000Z"}}