From 8c96f7b3aaaddbee1963d8010464ca93d17ef576 Mon Sep 17 00:00:00 2001 From: Zaggy1024 Date: Thu, 26 Feb 2026 23:03:35 -0600 Subject: [PATCH] LibCore: Stop atomically ref-counting EventReceiver Inheriting from AtomicRefCounted and Weakable is asking for misuse of WeakPtr to result in TOCTOU-caused UAFs. In order to ensure we're not misusing EventReceiver across threads, I ran test-web and some sites with a temporary hack to verify that ref()s and unref()s are always called from the same thread on the class. --- Libraries/LibCore/EventReceiver.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibCore/EventReceiver.h b/Libraries/LibCore/EventReceiver.h index 4f15fc74b7..bd8efe10dd 100644 --- a/Libraries/LibCore/EventReceiver.h +++ b/Libraries/LibCore/EventReceiver.h @@ -37,7 +37,7 @@ public: \ } class CORE_API EventReceiver - : public AtomicRefCounted + : public RefCounted , public Weakable { // NOTE: No C_OBJECT macro for Core::EventReceiver itself.