[krbdev.mit.edu #9304] [PATCH] Fix out-of-bounds read in fcc_ptcursor_next()

Богдан Богуславский via RT rt-comment at krbdev.mit.edu
Wed Dec 2 19:08:04 EST 2026


Wed Dec 02 19:08:04 2026: Request 9304 was acted upon.
 Transaction: Ticket created by boguslavskijbj at basealt.ru
       Queue: krb5
     Subject: [PATCH] Fix out-of-bounds read in fcc_ptcursor_next()
       Owner: Nobody
  Requestors: boguslavskijbj at basealt.ru
      Status: new
 Ticket <URL: https://krbdev.mit.edu/rt/Ticket/Display.html?id=9304 >


Hello,

The attached patch fixes an out-of-bounds read in fcc_ptcursor_next(), 
which is reached while enumerating credential caches.

When the default credential cache name does not start with FILE:, the 
function calls strchr(defname + 2, ':') to skip a possible drive prefix. 
If the name is empty or contains only one character, this pointer is 
beyond the string's terminating null byte, and strchr() reads past the 
allocated buffer.

The patch adds a string length check before calling strchr() to prevent 
the out-of-bounds read.

Regards,
Bogdan Boguslavskij

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Avoid-OOB-read-for-short-default-ccache-names.patch
Type: text/x-patch
Size: 1337 bytes
Desc: not available
URL: <http://mailman.mit.edu/pipermail/krb5-bugs/attachments/20261202/09368396/attachment.bin>


More information about the krb5-bugs mailing list