Skip to content

fix(security): close six Gunicorn worker AST scan bypasses (#238–#243) - #244

Closed
cursor[bot] wants to merge 1 commit into
mainfrom
security/fix-gunicorn-ast-scan-gaps-sep17
Closed

cursor[bot] wants to merge 1 commit into
mainfrom
security/fix-gunicorn-ast-scan-gaps-sep17

Conversation

@cursor

@cursor cursor Bot commented Sep 17, 2026

Copy link
Copy Markdown
Contributor

Summary

Scheduled security review found six remaining Gunicorn gunicorn.conf.py AST scanner gaps that let deployments start with RATELIMIT_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

Issue Location Impact Remediation
#238 walrus-if namespace .update() config.py Login rate-limit bypass across workers Flag instance .update({'workers': ...}) as dynamic
#239 match guard namespace update config.py Same Scan match case guards for worker mutations
#240 __init_subclass__ subclass definition config.py Same Treat subclass defs with mutating __init_subclass__ bases as dynamic
#241 dataclass __post_init__ config.py Same Record __post_init__ as constructor side-effect
#242 metaclass __new__ config.py Same Extend metaclass hook scan beyond __init__
#243 descriptor __get__ config.py Same Track descriptor field access side effects

Changes

  • Extend config.py worker-count AST scanner for the six patterns above.
  • Add tests/test_security_review_sep17.py regression coverage.

Scanned commit: 5217be4b10bc7c32738c568fd940c14ba31c0d5c

Open in Web View Automation 

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>
@coderabbitai

coderabbitai Bot commented Sep 17, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 8c798b58-06db-4f01-b9d3-607165f34d35

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@AlexanderWagnerDev
AlexanderWagnerDev deleted the security/fix-gunicorn-ast-scan-gaps-sep17 branch September 17, 2026 12:50
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.

2 participants