]> git.ipfire.org Git - thirdparty/krb5.git/commit
Fix read overruns in SPNEGO parsing
authorGreg Hudson <ghudson@mit.edu>
Wed, 8 Feb 2023 17:23:28 +0000 (12:23 -0500)
committerGreg Hudson <ghudson@mit.edu>
Thu, 6 Jul 2023 21:14:39 +0000 (17:14 -0400)
commiteb886f626526769e596443314bcbe4e8bd9d84ee
tree5cc37d5e7f3cf8e6f7f76e3b29fc19a74b90aadd
parent50f36406224533e15a796034a7d2301859e83635
Fix read overruns in SPNEGO parsing

Fix three read overruns discovered by the GitHub Security Lab team
(GHSL-2023-016, GHSL-2023-017, and GHSL-2023-018) using OSS-Fuzz.

In get_mech_set(), error out if gss_add_oid_set_member() fails rather
than continue the loop and increment i past the current bound of
returned_mechSet.  In g_verify_neg_token_init(), check for zero-byte
sequences before reading tag bytes, and reduce cur_size by one to
account for the tag byte when calling gssint_get_der_length().

(cherry picked from commit 47c2a12830dbd7fb8e13c239ddc0ac74129a91f6)

ticket: 9085
version_fixed: 1.20.2
src/lib/gssapi/spnego/spnego_mech.c