Skip to content

🛡️ Sentinel: [HIGH] Fix AsyncLogger DoS Vulnerability#96

Closed
TECHNICANGEL wants to merge 2 commits into
masterfrom
sentinel-async-logger-dos-fix-1559931231744731672
Closed

🛡️ Sentinel: [HIGH] Fix AsyncLogger DoS Vulnerability#96
TECHNICANGEL wants to merge 2 commits into
masterfrom
sentinel-async-logger-dos-fix-1559931231744731672

Conversation

@TECHNICANGEL

Copy link
Copy Markdown
Owner

Vulnerability: The AsyncLogger used an unbounded std::queue for log messages. If the main thread produced logs faster than the worker thread could write them to stdout/disk, the queue would grow indefinitely, leading to memory exhaustion and application crash (DoS).

Fix: Introduced a MAX_QUEUE_SIZE limit (10,000 messages). When the queue is full, new messages are dropped to preserve system stability. A warning is printed to stderr (once per overflow event) to alert administrators. The warning flag resets when the queue is emptied.

Verification: Confirmed fix using a reproduction script that pushes 100,000 messages rapidly. The script triggered the overflow warning and completed without crashing.


PR created automatically by Jules for task 1559931231744731672 started by @TECHNICANGEL

…ue size limit

- Added `MAX_QUEUE_SIZE` (10,000) to `AsyncLogger` to prevent unbounded memory growth.
- Implemented message dropping with a warning message to stderr when the queue overflows.
- Added `queueFullWarningShown` flag to prevent warning spam.
- Reset warning flag when queue is processed.

This prevents a potential Denial of Service vulnerability where a fast producer (e.g., render loop logging) could cause memory exhaustion if disk I/O or consumer thread lags behind.

Verified with a reproduction script that triggers the overflow condition.

Co-authored-by: TECHNICANGEL <197574689+TECHNICANGEL@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 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 @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

- Added `MAX_QUEUE_SIZE` (10,000) to `AsyncLogger` to prevent unbounded memory growth.
- Implemented message dropping with a warning message to stderr when the queue overflows.
- Added `queueFullWarningShown` flag to prevent warning spam.
- Reset warning flag when queue is processed.
- Removed duplicate declarations of `currentFPS` and `frameTimeMs` in `src/main.cpp` that caused CI build failures.

This prevents a potential Denial of Service vulnerability where a fast producer (e.g., render loop logging) could cause memory exhaustion if disk I/O or consumer thread lags behind.

Verified with a reproduction script that triggers the overflow condition and confirmed the build fix.

Co-authored-by: TECHNICANGEL <197574689+TECHNICANGEL@users.noreply.github.com>
@TECHNICANGEL
TECHNICANGEL deleted the sentinel-async-logger-dos-fix-1559931231744731672 branch February 23, 2026 15:37
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 this pull request may close these issues.

1 participant