Summary
sigstore-java has a vulnerability with bundle verification
sigstore-java has insufficient verification for a situation where a bundle provides a invalid signature for a checkpoint.
Steps To Reproduce
Build the java sigstore-cli at v1.1.0
git clone --branch v1.1.0 [email protected]: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
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.
"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"
}
./bin/sigstore-cli verify --bundle=blob.sigstore.json blob
# no errors???!
Workarounds
Verifiers may chose to verify the checkpoint manually after running KeylessVerifier.verify()
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");
}
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.
The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths. Typical impact: varies by context: data corruption, logic bypass, or denial of service.
Affected versions
Security releases
Kodem intelligence
Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Already deployed Kodem?
See it in your environmentNew to Kodem? Get a demo →Remediation advice
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
Frequently Asked Questions
- What is CVE-2024-54140? CVE-2024-54140 is a low-severity improper input validation vulnerability in dev.sigstore:sigstore-java (maven), affecting versions < 1.2.0. It is fixed in 1.2.0. The application does not adequately validate input before processing it, allowing unexpected values to reach sensitive code paths.
- Which versions of dev.sigstore:sigstore-java are affected by CVE-2024-54140? dev.sigstore:sigstore-java (maven) versions < 1.2.0 is affected.
- Is there a fix for CVE-2024-54140? Yes. CVE-2024-54140 is fixed in 1.2.0. Upgrade to this version or later.
- Is CVE-2024-54140 exploitable, and should I be worried? Whether CVE-2024-54140 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
- What actually determines whether CVE-2024-54140 is exploitable, and how bad it is? Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
- How do I fix CVE-2024-54140? Upgrade
dev.sigstore:sigstore-javato 1.2.0 or later.