You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
stack buffer overflow of Record Object in msilib #96577
hello.
There is a stack buffer overflow of Record object in msilib
After brief analysis, I was able to find that implementation of Record.GetString methods has a stack overflow vulnerability.
It seem to be implemented in msi.pyd file.
Vulnerable code snippet is below. pccValueBuf is the length of MsiRecordGetStringW() API, szValueBuf is a output buffer also this buffer has 4000 byte space from rsp, which means 2000 size of WCHAR.
I think there is slight mistake to calculate the buffer size.
Despite WCHAR is 2 byte, output size is still 4000, therefore stack buffer overflow could be happen.
Activity
zooba commentedon Sep 6, 2022
Yeah, looks like this line should be using an array size calculation, not plain
sizeof:cpython/PC/_msi.c
Line 487 in 95e271b
kumaraditya303 commentedon Sep 6, 2022
IIUC
Py_ARRAY_LENGTHcan be used there.pythongh-96577: Fixes buffer overrun in _msi module
gh-96577: Fixes buffer overrun in _msi module (GH-96633)
pythongh-96577: Fixes buffer overrun in _msi module (pythonGH-96633)
pythongh-96577: Fixes buffer overrun in _msi module (pythonGH-96633)
pythongh-96577: Fixes buffer overrun in _msi module (pythonGH-96633)
pythongh-96577: Fixes buffer overrun in _msi module (pythonGH-96633)
gh-96577: Fixes buffer overrun in _msi module (GH-96633)
gh-96577: Fixes buffer overrun in _msi module (GH-96633)
gh-96577: Fixes buffer overrun in _msi module (GH-96633) (GH-96659)
[3.9] gh-96577: Fixes buffer overrun in _msi module (GH-96633) (GH-96657
[3.8] gh-96577: Fixes buffer overrun in _msi module (GH-96633) (GH-96658