🛡️ Sentinel: [MEDIUM] Fix Unbounded Queue DoS in AsyncLogger#107
🛡️ Sentinel: [MEDIUM] Fix Unbounded Queue DoS in AsyncLogger#107TECHNICANGEL wants to merge 1 commit intomasterfrom
Conversation
- Add `MAX_QUEUE_SIZE` (10000) to `AsyncLogger` to prevent memory exhaustion (DoS). - Implement message dropping mechanism when queue is full. - Add thread-safe warning mechanism (`queueFullWarning`) to log overflow events to `stderr` without spamming. - Update `.Jules/sentinel.md` with DoS/Unbounded Queue learning. - Fix duplicate member declaration in `src/main.cpp` to fix compilation. Co-authored-by: TECHNICANGEL <197574689+TECHNICANGEL@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
This PR addresses a potential Denial of Service (DoS) vulnerability in the
AsyncLoggerclass where the message queue could grow indefinitely if the consumer thread (file/console I/O) is slower than the producer thread.Changes:
MAX_QUEUE_SIZEconstant (10000) toAsyncLogger.h.log()to drop messages if the queue is full.queueFullWarningflag to print a single warning tostd::cerrwhen the queue fills up, and reset it when the queue is fully drained by the worker thread.src/main.cppcaused by duplicate member variable declarations (currentFPS,frameTimeMs)..Jules/sentinel.md.Verification:
cmake --build .).PR created automatically by Jules for task 3670113622189682560 started by @TECHNICANGEL