fix(security): close six Gunicorn worker AST scan bypasses (#238–#243) - #244
Closed
cursor[bot] wants to merge 1 commit into
Closed
cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
Detect walrus-if and match-guard namespace updates, __init_subclass__ subclass definitions, dataclass __post_init__ instantiation, metaclass __new__ hooks, and descriptor __get__ attribute access that mutate workers at import time without being flagged as dynamic. Startup with RATELIMIT_STORAGE_URI=memory:// would otherwise allow multi-worker Gunicorn to bypass per-worker login rate limits and session stores while the panel believes it runs single-worker. Co-authored-by: Alexander Wagner <info@alexanderwagnerdev.com>
|
Important Review skippedBot user detected. To trigger a single review, invoke the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
AlexanderWagnerDev
deleted the
security/fix-gunicorn-ast-scan-gaps-sep17
branch
September 17, 2026 12:50
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Scheduled security review found six remaining Gunicorn
gunicorn.conf.pyAST scanner gaps that let deployments start withRATELIMIT_STORAGE_URI=memory://while Gunicorn actually runs multiple workers, bypassing per-worker login rate limits and session stores.Severity: Medium
Remote unauthenticated attackers can brute-force the panel login when operators (or compromised deploy artifacts) use hidden worker mutations in Gunicorn config.
Findings fixed
.update()config.py.update({'workers': ...})as dynamicmatchguard namespace updateconfig.pymatchcase guards for worker mutations__init_subclass__subclass definitionconfig.py__init_subclass__bases as dynamic__post_init__config.py__post_init__as constructor side-effect__new__config.py__init____get__config.pyChanges
config.pyworker-count AST scanner for the six patterns above.tests/test_security_review_sep17.pyregression coverage.Scanned commit:
5217be4b10bc7c32738c568fd940c14ba31c0d5c