All vulnerabilities

Go

CVE-2026-76101

keystore-go: Keystore integrity and password verification bypass via stripped trailing digest in Decode()

Severity
High 7.1
Published
19 Nov 2026
Last changed
19 Nov 2026
Added to UpHeron
23 Nov 2026
Fixed in
3.0.0
Exploit chance
under 0.1% in the next 30 daysEPSS by FIRST, 24 Nov 2026
Weakness
CWE-252Improper verification of a cryptographic signature (CWE-347)CWE-354
Attack
Needs local access · Needs a user account · No user action needed
Attacker can
Read data · Change data
CVSS vector
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:N
Also known as
GHSA-j282-pjg5-j643
Sources
OSV.dev and GitHub

Description

keystore.Decode() fails to check the error returned when reading the trailing SHA-1 integrity digest of a JKS keystore. If an attacker removes the final 20 bytes from a .jks file, the digest read returns an empty slice and the byte-comparison loop never executes, so Decode() returns the parsed keystore with err == nil. This defeats both tamper detection and — for certificate-only truststores — the password check itself, allowing an attacker with write access to a keystore file (but without knowledge of the keystore password) to silently inject or replace trusted CA certificates.

Affected versions: github.com/pavel-v-chernykh/keystore-go ≤ v2.1.0+incompatible (the final release on this module path). v3 and v4 releases are not impacted.

In decoder.go, function Decode, lines 264-272:

Two defects combine here:

  • The err returned by ksd.readBytes(20) on line 265 is assigned but never inspected.
  • The comparison loop on line 266 is bounded by len(actualDigest) rather than…
From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Affected software

SoftwareAffected versions
github.com/pavel-v-chernykh/keystore-goGo · osv:Go:github.com/pavel-v-chernykh/keystore-go
  • Every version up to 2.1.0
github.com/pavel-v-chernykh/keystore-go/v3Go · osv:Go:github.com/pavel-v-chernykh/keystore-go/v3
  • Every version before 3.0.0

About github.com/pavel-v-chernykh/keystore-go

This is the only vulnerability in github.com/pavel-v-chernykh/keystore-go in our list.

About github.com/pavel-v-chernykh/keystore-go/v3

This is the only vulnerability in github.com/pavel-v-chernykh/keystore-go/v3 in our list.

References