π‘οΈ Sentinel: [CRITICAL] Fix DoS vulnerability via massive integer conversion exhaustion#51
Conversation
β¦version exhaustion Co-authored-by: ManupaKDU <95234271+ManupaKDU@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. |
π¨ Severity: CRITICAL
π‘ Vulnerability: Denial of Service (DoS) via Application Crash.
Python 3.11+ limits integer-to-string conversions (e.g., calling
repr()or string formatting on massive ints) viasys.set_int_max_str_digits(default 4300 digits). If an attacker passed massive integers (e.g.,10**100000) as theiportimeoutarguments, the downstream string formatting andrepr()logging would fail with an unhandledValueError. This unhandled exception bubbles up and crashes the worker thread pool inconcurrent.futures, leading to a complete Denial of Service.π― Impact: An attacker or misconfigured client passing massive integer values could immediately crash the entire background scanning pool, halting all network scanning operations.
π§ Fix:
timeoutandipwhen they are of typeintto reject massive inputs immediately.repr()calls within loggingexceptblocks in atry...except ValueErrorto catch any remaining integer conversion limits and provide a safe<unrepresentable>fallback string.test_testping1.pycovering massive ints for both parameters and a malicious__repr__object.β Verification: Ran
python3 -m unittest test_testping1.pysuccessfully. Verified temporary testing files were removed.PR created automatically by Jules for task 8003572088896931687 started by @ManupaKDU