CVE-2022-23649: Github.com/sigstore/cosign Improper Certificate Validation Vulnerability
LOWCVE-2022-23649 is a LOW (CVSS 3.3) improper certificate validation vulnerability (CWE-295: Improper Certificate Validation) affecting Github.com/sigstore/cosign libraries in the Go ecosystem. The issue involves improper certificate validation in cosign. Remediation is available by upgrading affected packages to version 1.5.2.
CVE-2022-23649 at a Glance
Security Impact
CVSS: 3.3
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N).
How to Fix CVE-2022-23649
To remediate this vulnerability, upgrade all affected Github.com/sigstore/cosign dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
Upgrade github.com/sigstore/cosign to 1.5.2
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
inspect dependencies for github.com/sigstore/cosign
How to Check if You Are Affected
To determine whether your application is affected by CVE-2022-23649, inspect your project dependencies for Github.com/sigstore/cosign:
inspect dependencies for github.com/sigstore/cosign
Analyze the terminal output to locate any version of Github.com/sigstore/cosign in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.2), your application is affected.
Note: Verify declared build manifests and deployed runtime container environments.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-295: Improper Certificate Validation, where the product does not validate, or incorrectly validates, a certificate. In Github.com/sigstore/cosign, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
CVE-2022-23649 Affected Github.com/sigstore/cosign Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
github.com/sigstore/cosign
|
Go |
< 1.5.2
|
1.5.2
|
References
Frequently Asked Questions
What is CVE-2022-23649?
Which Github.com/sigstore/cosign versions are affected?
What version fixes CVE-2022-23649?
Is github.com/sigstore/cosign affected?
What is the CVSS score of CVE-2022-23649?
What CWE is associated with CVE-2022-23649?
How can I check Go dependencies for CVE-2022-23649?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-ccxc-vr6p-4858",
"modified" : "2022-03-08T18:26:05Z",
"published" : "2022-02-22T19:34:09Z",
"aliases" : [ "CVE-2022-23649" ],
"summary" : "Improper Certificate Validation in Cosign",
"details" : "### Impact\n\nCosign can be manipulated to claim that an entry for a signature exists in the Rekor transparency log even if it doesn't. This requires the attacker to have pull and push permissions for the signature in OCI. This can happen with both standard signing with a keypair and \"keyless signing\" with Fulcio.\n\n#### Signing with a keypair\n\n<details>\n\nTo reproduce this vulnerability, create a keypair and sign an image. Don't store the signature in Rekor:\n\n```\n$ cosign generate-key-pair \n$ cosign sign --key cosign.key IMAGE\n```\n\nIf an attacker has access to the signature in OCI, they can manipulate cosign into believing the entry was stored in Rekor even though it wasn't. To accomplish this, the attacker needs to:\n\n1. Pull the signature image\n2. Annotate the signature image with any valid Rekor bundle under the `dev.sigstore.cosign/bundle` annotation\n3. Push the signature image back to OCI\n\nVerification then prints out the following:\n\n```\n$ cosign verify [--key] [IMAGE]\n\nVerification for [IMAGE] --\nThe following checks were performed on each of these signatures:\n - The cosign claims were validated\n - Existence of the claims in the transparency log was verified offline\n - The signatures were verified against the specified public key\n - Any certificates were verified against the Fulcio roots.\n\n[…]\n```\n\nThe claim that `Existence of the claims in the transparency log was verified offline` is inaccurate since an entry for this image doesn't exist in the log.\nThe claim that `Any certificates were verified against the Fulcio roots.` is technically correct but since there were no certificates that should be explicitly called out.\n\n</details>\n\n#### \"Keyless signing\" with an OIDC flow\n\n<details>\n\nTo reproduce this vulnerability, sign the image with a Fulcio identity. Don't store the signature in Rekor: \n```\n$ COSIGN_EXPERIMENTAL=1 cosign sign IMAGE\n[...]\nIMAGE appears to be a private repository, please confirm uploading to the transparency log at \"https://rekor.sigstore.dev\" [Y/N]: n\n\n```\n\nThen, create a keypair and sign the image again. Store an entry for the signature in Rekor:\n\n```\n$ cosign generate-key-pair \n$ COSIGN_EXPERIMENTAL=1 cosign sign --key cosign.key IMAGE\n\nEnter password for private key: IMAGE appears to be a private repository, please confirm uploading to the transparency log at \"https://rekor.sigstore.dev\" [Y/N]: y\n```\n\nIf an attacker has access to the signature in OCI, they can manipulate cosign into believing the entry was stored in Rekor even though it wasn't. To accomplish this, the attacker needs to:\n\n1. Pull the signature image\n2. Copy the rekor bundle from the second signature into the first signature under the `dev.sigstore.cosign/bundle` annotation\n3. Push the signature image back to OCI\n\n_Note: For this to work, both signatures must occur during the valid lifespan of the certificate (~20 minutes)._\n\nVerification then prints out the following:\n\n```\n$ cosign verify [--key] [IMAGE]\n\nVerification for [IMAGE] --\nThe following checks were performed on each of these signatures:\n - The cosign claims were validated\n - Existence of the claims in the transparency log was verified offline\n - The signatures were verified against the specified public key\n - Any certificates were verified against the Fulcio roots.\n\n[…]\n```\n\nThe claim that `Existence of the claims in the transparency log was verified offline` is inaccurate since an entry for this image doesn't exist in the log.\n\nThe claim that `Any certificates were verified against the Fulcio roots.` is technically correct but since there were no certificates that should be explicitly called out.\n\n</details>\n\n\n### Patches\nThe vulnerability has been patched in v1.5.2 of cosign.\n\nThe `signature` in the `signedEntryTimestamp` provided by Rekor is now compared to the `signature` that is being verified. If these don't match, then an error is returned. If a valid bundle is copied to a different signature, verification should fail. \n\nCosign output now only informs the user that certificates were verified if a certificate was in fact verified.\n\n\n### Workarounds\nThe only workaround is upgrading.\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [cosign](https://github.com/sigstore/cosign)\n* Send us a message on [Slack](https://sigstore.slack.com/). Invite link [here](https://join.slack.com/t/sigstore/shared_invite/zt-mhs55zh0-XmY3bcfWn4XEyMqUUutbUQ).\n\n### Thank you\nThank you to @mtrmac for finding and reporting this vulnerability.\n\nThank you to everyone who worked on fixing this:\n* @nsmith5\n* @znewman01 \n* @dlorenc\n* @mattmoor \n* @priyawadhwa\n",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "Go",
"name" : "github.com/sigstore/cosign"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.5.2"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/sigstore/cosign/security/advisories/GHSA-ccxc-vr6p-4858"
}, {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-23649"
}, {
"type" : "WEB",
"url" : "https://github.com/sigstore/cosign/commit/96d410a6580e4e81d24d112a0855c70ca3fb5b49"
}, {
"type" : "WEB",
"url" : "https://github.com/sigstore/cosign"
}, {
"type" : "WEB",
"url" : "https://github.com/sigstore/cosign/releases/tag/v1.5.2"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-295" ],
"severity" : "LOW",
"github_reviewed" : true,
"github_reviewed_at" : "2022-02-22T19:34:09Z",
"nvd_published_at" : "2022-02-18T22:15:00Z"
}
}