fix: add memory protection to lookup rate limiting
ENUM-002: Lookup rate limit now respects LOOKUP_RATE_LIMIT_MAX_ENTRIES (default 10000) to prevent memory exhaustion from unique IP flood. Eviction strategy: expired entries first, then oldest by last request.
This commit is contained in:
@@ -115,6 +115,10 @@ class Config:
|
||||
)
|
||||
LOOKUP_RATE_LIMIT_WINDOW = int(os.environ.get("FLASKPASTE_LOOKUP_RATE_WINDOW", "60"))
|
||||
LOOKUP_RATE_LIMIT_MAX = int(os.environ.get("FLASKPASTE_LOOKUP_RATE_MAX", "60"))
|
||||
# ENUM-002: Maximum tracked IPs for lookup rate limiting (memory protection)
|
||||
LOOKUP_RATE_LIMIT_MAX_ENTRIES = int(
|
||||
os.environ.get("FLASKPASTE_LOOKUP_RATE_MAX_ENTRIES", "10000")
|
||||
)
|
||||
|
||||
# Audit Logging
|
||||
# Track security-relevant events (paste creation, deletion, rate limits, etc.)
|
||||
|
||||
Reference in New Issue
Block a user