Skip to content

Commit a79c4ce

Browse files
Viktor Dukhovnit8m
authored andcommitted
kek_unwrap_key(): Fix incorrect check of unwrapped key size
Fixes CVE-2025-9230 The check is off by 8 bytes so it is possible to overread by up to 8 bytes and overwrite up to 4 bytes. Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (cherry picked from commit 9c462be)
1 parent 7e0fc05 commit a79c4ce

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎crypto/cms/cms_pwri.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static int kek_unwrap_key(unsigned char *out, size_t *outlen,
229229
/* Check byte failure */
230230
goto err;
231231
}
232-
if (inlen < (size_t)(tmp[0] - 4)) {
232+
if (inlen < 4 + (size_t)tmp[0]) {
233233
/* Invalid length value */
234234
goto err;
235235
}

0 commit comments

Comments
 (0)