Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is heap-based buffer overflow #8547

Closed
KaanaryOverFlow opened this issue Apr 21, 2022 · 2 comments · Fixed by #8548
Closed

There is heap-based buffer overflow #8547

KaanaryOverFlow opened this issue Apr 21, 2022 · 2 comments · Fixed by #8548

Comments

@KaanaryOverFlow
Copy link

the function is vulnerable

you can fix it

https://medium.com/@Mr.deadbeef.py/esp-unusable-heap-based-buffer-overlow-ba6e8d99f813

@mcspr
Copy link
Collaborator

mcspr commented Apr 21, 2022

We would appreciate a concise description of the issue, not the link to your blog :/
What's your suggestion for a fix here?

I think what you meant is that this line uses char to store the result of strlen(username) + strlen(password) + 1, and it must stay under 127 bytes to not overflow the value

char toencodeLen = strlen(username)+strlen(password)+1;

@mcspr mcspr linked a pull request Apr 21, 2022 that will close this issue
@KaanaryOverFlow
Copy link
Author

i prefer this solution, exactly, in this line should be validate string length lower than 127 bytes before defining "toencodeLen" for username and password
if you are want to error exception or you can use snprintf(buffer,toencodeLen+1,...) instead of sprintf.

the case is when remote user access the this function, they can trig to overflow

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants