CVE-2024-54140: Sigstore java Sigstore-java Has A Vulnerability With Vulnerability

LOW
Advisory Identifier: GHSA-jp26-88mw-89qr
CWE-20
Published
Advisory Summary

CVE-2024-54140 is a LOW sigstore-java has a vulnerability with vulnerability (CWE-20: Improper Input Validation) affecting Sigstore java libraries in the Maven ecosystem. The issue involves sigstore-java has a vulnerability with bundle verification. Remediation is available by upgrading affected packages to version 1.2.0.

CVE-2024-54140 at a Glance

CVE Identifier CVE-2024-54140
GHSA Identifier GHSA-jp26-88mw-89qr
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-20: Improper Input Validation
Affected Product Sigstore java
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2024-54140

To remediate this vulnerability, upgrade all affected Sigstore java dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

dev.sigstore:sigstore-java fixed: 1.2.0
<dependency>
    <groupId>dev.sigstore</groupId>
    <artifactId>sigstore-java</artifactId>
    <version>1.2.0</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=dev.sigstore

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2024-54140, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=dev.sigstore

Analyze the terminal output to locate any version of Sigstore java in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.2.0), your application is affected.

Note: The mvn dependency:tree -Dincludes=dev.sigstore command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-20: Improper Input Validation, where the product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. In Sigstore java, 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

### Summary sigstore-java has insufficient verification for a situation where a bundle provides a invalid signature for a checkpoint. ### Impact This bug impacts clients using any variation of KeylessVerifier.verify() Currently checkpoints are only used to ensure the root hash of an inclusion proof was provided by the log in question. Failing to validate that means a bundle may provide an inclusion proof that doesn't actually correspond to the log in question. This may eventually lead a monitor/witness being unable to detect when a compromised logs are providing different views of themselves to different clients. There are other mechanisms right now that mitigate this, such as the signed entry timestamp. Sigstore-java currently requires a valid signed entry timestamp. By correctly verifying the signed entry timestamp we can make certain assertions about the log signing the log entry (like the log was aware of the artifact signing event and signed it). Therefore the impact on clients that are not monitors/witnesses is very low. All cryptographic materials and identity information in the bundle must still be verified for the verification to pass. A valid signed entry timestamp is still required for verification to pass. sigstore-gradle-plugin and sigstore-maven-plugin are not affected by this as they only provide signing functionality. ### Steps To Reproduce Build the java sigstore-cli at v1.1.0 ```shell git clone --branch v1.1.0 git@github.com:sigstore/sigstore-java cd sigstore-java ./gradlew :sigstore-cli:build tar -xf sigstore-cli/build/distributions/sigstore-cli-1.1.0-SNAPSHOT.tar --strip-components 1 ``` Create some random blob and sign it ```shell dd bs=1 count=50 </dev/urandom > blob ./bin/sigstore-cli sign --bundle=blob.sigstore.json blob ``` Modify the checkpoint signature on the bundle, this is the last base64 section in the checkpoint, the following diff just swaps changes the last 3 base64 characters to aaa. ```diff "checkpoint": { + "envelope": "rekor.sigstore.dev - 1193050959916656506\n29874050\nhnEOPEa6SDzqJDydU+J96TQyfYfqEpsGg0aVbmfjWDw\u003d\n\n— rekor.sigstore.dev wNI9ajBFAiEA4M7t/9b42FzeArRhC6oRvs7UvKwklaFLYfDDGTi2R4kCIBNc2d0VCyUbs3hd+bI7+0RHhvLOdAqYg7j/3xPe2ZPb\n" - "envelope": "rekor.sigstore.dev - 1193050959916656506\n29874050\nhnEOPEa6SDzqJDydU+J96TQyfYfqEpsGg0aVbmfjWDw\u003d\n\n— rekor.sigstore.dev wNI9ajBFAiEA4M7t/9b42FzeArRhC6oRvs7UvKwklaFLYfDDGTi2R4kCIBNc2d0VCyUbs3hd+bI7+0RHhvLOdAqYg7j/3xPe2aaa\n" } ``` ```shell ./bin/sigstore-cli verify --bundle=blob.sigstore.json blob # no errors???! ``` ### Patches Patched in v1.2.0 release (patch: https://github.com/sigstore/sigstore-java/commit/23fb4885e6704a5df4977f7acf253a745349edf9) Conformance tests added https://github.com/sigstore/sigstore-conformance/pull/139 ### Workarounds Verifiers may chose to verify the checkpoint manually after running `KeylessVerifier.verify()` ```java var bundle = Bundle.from(bundleFile, StandardCharsets.UTF_8); var entry = bundle.getEntries().get(0); var checkpoint = entry.getVerification().getInclusionProof().parsedCheckpoint(); var signedData = Splitter.on("\n\n").splitToList(entry.getVerification().getInclusionProof().getCheckpoint()).get(0) + "\n"; var tufClient = SigstoreTufClient.builder().usePublicGoodInstance().build(); tufClient.update(); var trustedRoot = tufClient.getSigstoreTrustedRoot(); var tlog = TransparencyLog.find(trustedRoot.getTLogs(), Hex.decode(entry.getLogID()), entry.getIntegratedTimeInstant()); if (!Verifiers.newVerifier(tlog.get().getPublicKey().toJavaPublicKey()).verify(signedData.getBytes(StandardCharsets.UTF_8), checkpoint.getSignatures().get(0).getSignature())) { throw new Exception("Checkpoint signature was invalid"); } ```

CVE-2024-54140 Affected Sigstore java Versions

1 component(s)
Fixed Versions:
1.2.0
Product / Package Ecosystem Affected Versions Fixed Version
dev.sigstore:sigstore-java
Maven
< 1.2.0
1.2.0

References

Frequently Asked Questions

What is CVE-2024-54140?
CVE-2024-54140 is a security vulnerability in Sigstore java involving sigstore-java has a vulnerability with bundle verification under CWE-20: Improper Input Validation.
Which Sigstore java versions are affected?
Affected versions include releases prior to 1.2.0 across affected packages: dev.sigstore:sigstore-java.
What version fixes CVE-2024-54140?
Upgrading to 1.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sigstore-java affected?
Yes, dev.sigstore:sigstore-java is affected in releases prior to 1.2.0. Upgrade your dependency to 1.2.0 or later.
What CWE is associated with CVE-2024-54140?
CVE-2024-54140 is classified under CWE-20: Improper Input Validation (The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly.).
How can I check Maven dependencies for CVE-2024-54140?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=dev.sigstore'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-jp26-88mw-89qr",
  "modified" : "2024-12-06T00:32:50Z",
  "published" : "2024-12-05T22:22:49Z",
  "aliases" : [ "CVE-2024-54140" ],
  "summary" : "sigstore-java has a vulnerability with bundle verification",
  "details" : "### Summary\nsigstore-java has insufficient verification for a situation where a bundle provides a invalid signature for a checkpoint.\n\n### Impact\nThis bug impacts clients using any variation of KeylessVerifier.verify()\n\nCurrently checkpoints are only used to ensure the root hash of an inclusion proof was provided by the log in question. Failing to validate that means a bundle may provide an inclusion proof that doesn't actually correspond to the log in question. This may eventually lead a monitor/witness being unable to detect when a compromised logs are providing different views of themselves to different clients.\n\nThere are other mechanisms right now that mitigate this, such as the signed entry timestamp. Sigstore-java currently requires a valid signed entry timestamp. By correctly verifying the signed entry timestamp we can make certain assertions about the log signing the log entry (like the log was aware of the artifact signing event and signed it). Therefore the impact on clients that are not monitors/witnesses is very low.\n\nAll cryptographic materials and identity information in the bundle must still be verified for the verification to pass. A valid signed entry timestamp is still required for verification to pass.\n\nsigstore-gradle-plugin and sigstore-maven-plugin are not affected by this as they only provide signing functionality.\n\n### Steps To Reproduce\nBuild the java sigstore-cli at v1.1.0\n```shell\ngit clone --branch v1.1.0 git@github.com:sigstore/sigstore-java\ncd sigstore-java\n./gradlew :sigstore-cli:build\ntar -xf sigstore-cli/build/distributions/sigstore-cli-1.1.0-SNAPSHOT.tar --strip-components 1\n```\n\nCreate some random blob and sign it\n```shell\ndd bs=1 count=50 </dev/urandom > blob\n./bin/sigstore-cli sign --bundle=blob.sigstore.json blob\n```\n\nModify the checkpoint signature on the bundle, this is the last base64 section in the checkpoint, the following diff just swaps changes the last 3 base64 characters to aaa.\n```diff\n\"checkpoint\": {\n+    \"envelope\": \"rekor.sigstore.dev - 1193050959916656506\\n29874050\\nhnEOPEa6SDzqJDydU+J96TQyfYfqEpsGg0aVbmfjWDw\\u003d\\n\\n— rekor.sigstore.dev wNI9ajBFAiEA4M7t/9b42FzeArRhC6oRvs7UvKwklaFLYfDDGTi2R4kCIBNc2d0VCyUbs3hd+bI7+0RHhvLOdAqYg7j/3xPe2ZPb\\n\"\n-    \"envelope\": \"rekor.sigstore.dev - 1193050959916656506\\n29874050\\nhnEOPEa6SDzqJDydU+J96TQyfYfqEpsGg0aVbmfjWDw\\u003d\\n\\n— rekor.sigstore.dev wNI9ajBFAiEA4M7t/9b42FzeArRhC6oRvs7UvKwklaFLYfDDGTi2R4kCIBNc2d0VCyUbs3hd+bI7+0RHhvLOdAqYg7j/3xPe2aaa\\n\"\n}\n```\n\n```shell\n./bin/sigstore-cli verify --bundle=blob.sigstore.json blob\n# no errors???!\n```\n### Patches\nPatched in v1.2.0 release (patch: https://github.com/sigstore/sigstore-java/commit/23fb4885e6704a5df4977f7acf253a745349edf9)\nConformance tests added https://github.com/sigstore/sigstore-conformance/pull/139\n\n### Workarounds\nVerifiers may chose to verify the checkpoint manually after running `KeylessVerifier.verify()`\n```java\nvar bundle = Bundle.from(bundleFile, StandardCharsets.UTF_8);\nvar entry = bundle.getEntries().get(0);\nvar checkpoint = entry.getVerification().getInclusionProof().parsedCheckpoint();\nvar signedData = Splitter.on(\"\\n\\n\").splitToList(entry.getVerification().getInclusionProof().getCheckpoint()).get(0) + \"\\n\";\n\nvar tufClient = SigstoreTufClient.builder().usePublicGoodInstance().build();\ntufClient.update();\nvar trustedRoot = tufClient.getSigstoreTrustedRoot();\nvar tlog =  TransparencyLog.find(trustedRoot.getTLogs(), Hex.decode(entry.getLogID()), entry.getIntegratedTimeInstant());\n\nif (!Verifiers.newVerifier(tlog.get().getPublicKey().toJavaPublicKey()).verify(signedData.getBytes(StandardCharsets.UTF_8), checkpoint.getSignatures().get(0).getSignature())) {\n  throw new Exception(\"Checkpoint signature was invalid\");\n}\n```\n",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:P/PR:N/UI:N/VC:N/VI:L/VA:N/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "dev.sigstore:sigstore-java"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/sigstore/sigstore-java/security/advisories/GHSA-jp26-88mw-89qr"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-54140"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sigstore/sigstore-conformance/pull/139"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/sigstore/sigstore-java/commit/23fb4885e6704a5df4977f7acf253a745349edf9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/sigstore/sigstore-java"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-20" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-12-05T22:22:49Z",
    "nvd_published_at" : "2024-12-05T22:15:20Z"
  }
}