Describe the bug
There is a buffer overflow in the native windows PDB.exe binary due to an unchecked call to strncpy in pdb/cpp/util.cpp
To Reproduce
Steps to reproduce the behavior:
pdb.exe binary in the debugger of your choice with the following arguments: fakefilename.pdb AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA- 0Expected behavior
An error to be thrown if the string to be copied is larger than the stack buffer size (256).
Environment (please complete the following information):
Additional context
I was not going to submit this originally because I don't believe it to be actually exploitable, but I figured that somebody else should decide on that.
I don't think this is exploitable through loading a malicious pdb into Ghidra, as the GUID and signature are stored as the GUID and int types respectively before being passed to pdb.exe, effectively limiting their values, lengths, and formats.
Maybe not exploitable, but that's not the first buffer overflow we've found in this code (and likely not the last). This code needs to be scrubbed, if not replaced.
Most helpful comment
Maybe not exploitable, but that's not the first buffer overflow we've found in this code (and likely not the last). This code needs to be scrubbed, if not replaced.