{"id":"CVE-2026-74878","aliases":["GHSA-h45m-mgcp-q388"],"title":"openssl-encrypt: TOTP rate limiter is in-memory only — not shared across workers, lost on restart","summary":"openssl-encrypt: TOTP rate limiter is in-memory only — not shared across workers, lost on restart","severity":"critical","vendor":"openssl-encrypt","product":"openssl-encrypt","ecosystem":"pip","affected":["openssl-encrypt < 1.4.0"],"patched":["openssl-encrypt 1.4.0"],"published":"2026-03-31","updated":"2026-08-18","source":"OSV","sourceUrl":"https://osv.dev/vulnerability/GHSA-h45m-mgcp-q388","references":[{"url":"https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-h45m-mgcp-q388"},{"url":"https://github.com/jahlives/openssl_encrypt/commit/2749bc0949b34a5921a35fb4a3f1856fc51916de"},{"url":"https://github.com/jahlives/openssl_encrypt"}],"tags":["osv","pip"],"ingestedAt":"2026-08-18T12:28:08.759Z","epss":0.00749,"epssPercentile":0.52894,"slug":"CVE-2026-74878","body":"## Overview\n\n## Severity: HIGH\n\n### Summary\n\nThe TOTP brute-force rate limiter in `openssl_encrypt_server/modules/pepper/totp.py` at **lines 47-98** uses an in-memory `defaultdict(list)` as a class variable.\n\n### Affected Code\n\n```python\nclass TOTPRateLimiter:\n    def __init__(self, ...):\n        self.attempts: Dict[str, List[datetime]] = defaultdict(list)\n        self.lockouts: Dict[str, datetime] = {}\n\nclass TOTPService:\n    _rate_limiter = TOTPRateLimiter()  # Class variable, in-memory only\n```\n\n### Impact\n\n1. Rate limit state is **not shared** across multiple server instances/workers — an attacker can distribute attempts\n2. All rate limit state is **lost on server restart** — allows immediate retry\n3. In multi-worker deployments, each worker has independent rate limit state\n\n### Recommended Fix\n\n- Use Redis or the database for rate limit state storage\n- Or use a shared-memory approach for multi-worker deployments\n- At minimum, persist lockout state to survive restarts\n\n### Fix\n\nFixed in commit `2749bc0` on branch `releases/1.4.x` — added abstract RateLimitBackend with InMemoryBackend and DatabaseBackend implementations; defaults to DatabaseBackend when DB available.\n\n## Affected packages\n\n- `openssl-encrypt < 1.4.0`\n\n## Remediation\n\nUpgrade to a patched release:\n\n- `openssl-encrypt 1.4.0`","depth":"midnight","depthScore":52,"depthScoreParts":{"impact":52.3,"likelihood":0.1,"exploitation":0,"ransomware":0},"changes":[]}