-
Notifications
You must be signed in to change notification settings - Fork 257
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
Buffer overflow in ws_read() #69
Comments
Hi Oscar, it was already fixed on an idf branch, but will be merged to master once IDFv3.2 is released. Latest IDF already refers to the fixed esp-mqtt, so if you can please check the esp-idf master (no need to add esp-mqtt) and see the issue fixed, might you help closing this issue, please? Thank you, |
Hi David, I'm no longer working on the project that encountered this bug, but I will try to persuade my colleague to test the fix. Is there an estimated release date for v3.2? Kind regards, |
Hi, Not a planned release date for IDFv3.2 yet, but we can expect somewhere in late November. Thanks for mentioning to your colleagues 👍 Regards, |
Hi guys, |
Hi @jejer This fix is still in esp internal repo, but updated the commit message so will get notified once it's merged and published to GitHub The fix I was talking about in October addressed only longer messages (this is handed correctly in mqtt_client.c when reading payload only by underlying transport -- tcp for ws). however there's still an issue if multiple shorter websocket messages reside in one read buffer and that must be handled in idf in ws_read() |
Hi @david-cermak |
…ead the exact payload closes espressif/esp-mqtt#69
…ead the exact payload closes espressif/esp-mqtt#69
A buffer overflow occurs when a websocket frame is bigger then the receive buffer is received.
len
holds the read buffer length.rlen
represents the number of bytes read and should be equal or smaller thenlen
.payload_len
is extracted out of the received data and is used to process the received data.However
payload_len
is never checked againstrlen
. This results into a buffer overflow when a websocket frame bigger then the receive buffer is received.The text was updated successfully, but these errors were encountered: