{"id":"CVE-2024-29902","aliases":["CVE-2024-29902","GHSA-88jx-383q-w4qc","BIT-COSIGN-2024-29902","GO-2024-2718"],"related":["CGA-j372-gcfv-2369"],"kind":"vulnerability","state":"published","title":"Cosign vulnerable to system-wide denial of service via malicious attachments","summary":"Cosign provides code signing and transparency for containers and binaries. Prior to version 2.2.4, a remote image with a malicious attachment can cause denial of service of the host machine running Cosign. This can impact other services on the machine that rely on having memory available such as a Redis database which can result in data loss. It can also impact the availability of other services on the machine that will not be available for the duration of the machine denial. The root cause of this issue is that Cosign reads the attachment from a remote image entirely into memory without checking the size of the attachment first. As such, a large attachment can make Cosign read a large attachment into memory; If the attachments size is larger than the machine has memory available, the machine will be denied of service. The Go runtime will make a SigKill after a few seconds of system-wide denial. This issue can allow a supply-chain escalation from a compromised registry to the Cosign user: If an attacher has compromised a registry or the account of an image vendor, they can include a malicious attachment and hurt the image consumer. 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, a remote image with a malicious attachment can cause denial of service of the host machine running Cosign. This can impact other services on the machine that rely on having memory available such as a Redis database which can result in data loss. It can also impact the availability of other services on the machine that will not be available for the duration of the machine denial. The root cause of this issue is that Cosign reads the attachment from a remote image entirely into memory without checking the size of the attachment first. As such, a large attachment can make Cosign read a large attachment into memory; If the attachments size is larger than the machine has memory available, the machine will be denied of service. The Go runtime will make a SigKill after a few seconds of system-wide denial. This issue can allow a supply-chain escalation from a compromised registry to the Cosign user: If an attacher has compromised a registry or the account of an image vendor, they can include a malicious attachment and hurt the image consumer. Version 2.2.4 contains a patch for the vulnerability.","source":"cvelist"},{"lang":"en","text":"### Summary\nA remote image with a malicious attachment can cause denial of service of the host machine running Cosign. This can impact other services on the machine that rely on having memory available such as a Redis database which can result in data loss. It can also impact the availability of other services on the machine that will not be available for the duration of the machine denial.\n\n### Details\nThe root cause of this issue is that Cosign reads the attachment from a remote image entirely into memory without checking the size of the attachment first. As such, a large attachment can make Cosign read a large attachment into memory; If the attachments size is larger than the machine has memory available, the machine will be denied of service. The Go runtime will make a `SIGKILL` after a few seconds of system-wide denial.\n\nThe root cause is that Cosign reads the contents of the attachments entirely into memory on line 238 below:\n\nhttps://github.com/sigstore/cosign/blob/9bc3ee309bf35d2f6e17f5d23f231a3d8bf580bc/pkg/oci/remote/remote.go#L228-L239\n\n...and prior to that, neither Cosign nor go-containerregistry checks the size of the attachment and enforces a max cap. In the case of a remote layer of `f *attached`, go-containerregistry will invoke this API:\n\nhttps://github.com/google/go-containerregistry/blob/a0658aa1d0cc7a7f1bcc4a3af9155335b6943f40/pkg/v1/remote/layer.go#L36-L40\n```golang\nfunc (rl *remoteLayer) Compressed() (io.ReadCloser, error) {\n\t// We don't want to log binary layers -- this can break terminals.\n\tctx := redact.NewContext(rl.ctx, \"omitting binary blobs from logs\")\n\treturn rl.fetcher.fetchBlob(ctx, verify.SizeUnknown, rl.digest)\n}\n```\n\nNotice that the second argument to `rl.fetcher.fetchBlob` is `verify.SizeUnknown` which results in not using the `io.LimitReader` in `verify.ReadCloser`:\nhttps://github.com/google/go-containerregistry/blob/a0658aa1d0cc7a7f1bcc4a3af9155335b6943f40/internal/verify/verify.go#L82-L100\n```golang\nfunc ReadCloser(r io.ReadCloser, size int64, h v1.Hash) (io.ReadCloser, error) {\n\tw, err := v1.Hasher(h.Algorithm)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tr2 := io.TeeReader(r, w) // pass all writes to the hasher.\n\tif size != SizeUnknown {\n\t\tr2 = io.LimitReader(r2, size) // if we know the size, limit to that size.\n\t}\n\treturn &and.ReadCloser{\n\t\tReader: &verifyReader{\n\t\t\tinner:    r2,\n\t\t\thasher:   w,\n\t\t\texpected: h,\n\t\t\twantSize: size,\n\t\t},\n\t\tCloseFunc: r.Close,\n\t}, nil\n}\n```\n\n### Impact\nThis issue can allow a supply-chain escalation from a compromised registry to the Cosign user: If an attacher has compromised a registry or the account of an image vendor, they can include a malicious attachment and hurt the image consumer. \n\n### Remediation\nUpdate to the latest version of Cosign, which limits the number of attachments. An environment variable can override this value.","format":"markdown","source":"ghsa"},{"lang":"en","text":"Cosign malicious attachments can cause system-wide denial of service 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, una imagen remota con un archivo adjunto malicioso podía provocar una denegación de servicio en la máquina host que ejecuta Cosign. Esto puede afectar a otros servicios de la máquina que dependen de la memoria disponible, como una base de datos de Redis, lo que puede provocar la pérdida de datos. También puede afectar la disponibilidad de otros servicios en la máquina que no estarán disponibles mientras dure la denegación de la máquina. La causa principal de este problema es que Cosign lee el archivo adjunto de una imagen remota completamente en la memoria sin verificar primero el tamaño del archivo adjunto. Como tal, un archivo adjunto grande puede hacer que Cosign lea un archivo adjunto grande en la memoria; Si el tamaño de los archivos adjuntos es mayor que la memoria disponible de la máquina, se le negará el servicio a la máquina. El tiempo de ejecución de Go realizará un SigKill después de unos segundos de denegación en todo el sistema. Este problema puede permitir una escalada de la cadena de suministro desde un registro comprometido hasta el usuario de Cosign: si un adjunto ha comprometido un registro o la cuenta de un proveedor de imágenes, puede incluir un archivo adjunto malicioso y dañar al consumidor de la imagen. La versión 2.2.4 contiene un parche para la vulnerabilidad.","source":"nvd"}],"published":"2024-04-10T22:28:19.788Z","modified":"2026-09-10T03:50:12.472Z","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:H/PR:N/UI:N/S:U/C:N/I:N/A:H","score":5.9,"rating":"MEDIUM"},{"scorer":"Bitnami Vulnerability Database","scheme":"rating","rating":"MEDIUM"}],"cwes":["CWE-770"],"affected":[{"ranges":[{"version":"< 2.2.4","status":"affected"}],"vendor":"sigstore","product":"cosign","source":"cvelist"},{"ranges":[{"type":"custom","introduced":"0.1.0","fixed":"2.2.4","status":"affected"}],"vendor":"sigstore","product":"cosign","cpe":"cpe:2.3:a:sigstore:cosign:0.1.0:*:*:*:*:*:*:*","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-88jx-383q-w4qc","tags":["advisory","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/google/go-containerregistry/blob/a0658aa1d0cc7a7f1bcc4a3af9155335b6943f40/pkg/v1/remote/layer.go#L36-L40","tags":["product","web","x-refsource-misc","x-transferred"],"sources":["cvelist","ghsa","go","nvd","bitnami"]},{"url":"https://github.com/sigstore/cosign/blob/9bc3ee309bf35d2f6e17f5d23f231a3d8bf580bc/pkg/oci/remote/remote.go#L228-L239","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-29902","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-06-03T14:13:43.671Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-29902","url":"https://www.cve.org/CVERecord?id=CVE-2024-29902","licence":"CVE Terms of Use","modified":"2024-08-02T01:17:58.609Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-88jx-383q-w4qc","url":"https://github.com/advisories/GHSA-88jx-383q-w4qc","licence":"CC-BY-4.0","modified":"2026-09-10T03:50:12.472Z"},{"source":"go","name":"Go Vulnerability Database","id":"GO-2024-2718","url":"https://pkg.go.dev/vuln/GO-2024-2718","licence":"CC-BY-4.0","modified":"2026-02-04T03:18:34.975Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-29902","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-29902","licence":"Public domain","modified":"2026-06-17T07:23:20.123Z"},{"source":"bitnami","name":"Bitnami Vulnerability Database","id":"BIT-COSIGN-2024-29902","url":"https://osv.dev/vulnerability/BIT-COSIGN-2024-29902","licence":"Apache-2.0","modified":"2026-09-08T08:46:03.197Z"}],"updatedAt":"2026-11-25T22:58:39.082Z","epss":{"score":0.00658,"percentile":0.52779,"date":"2026-12-01T12:00:22.000Z"}}