-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Heap use after free detected in libwebsockets wsi.c #3564
Description
We have a linux application using libwebsockets with libuv, calling lws_cancel_service to interact with the service loop. While Debugging, we use address sanitizing to detect memory leaks because those could become security concerns for our use case.
Unfortunately, whenever i try to disconnect from the server i connect to over libwebsockets, i get a heap-use-after-free in libwebsockets/lib/core-net/wsi.c:510 (in user_callback_handle_rxflow).
The function is pretty simple so i think we can assume it's the wsi pointer which was previously freed. During our disconnect handling, we do destroy the lws context with the wsi, and our own ssl context.
I'm not really sure where to take the issue from here. Either we are doing something very wrong, or there is a use after free in libwebsockets, but i'm not ruling out the former.