GHSA-h45m-mgcp-q388

Suggest an improvement
Source
https://github.com/advisories/GHSA-h45m-mgcp-q388
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-h45m-mgcp-q388/GHSA-h45m-mgcp-q388.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-h45m-mgcp-q388
Published
2026-03-31T23:41:26Z
Modified
2026-03-31T23:49:41.118117Z
Severity
  • 9.1 (Critical) CVSS_V4 - CVSS:4.0/AV:N/AC:H/AT:N/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N CVSS Calculator
Summary
openssl-encrypt: TOTP rate limiter is in-memory only — not shared across workers, lost on restart
Details

Severity: HIGH

Summary

The 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.

Affected Code

class TOTPRateLimiter:
    def __init__(self, ...):
        self.attempts: Dict[str, List[datetime]] = defaultdict(list)
        self.lockouts: Dict[str, datetime] = {}

class TOTPService:
    _rate_limiter = TOTPRateLimiter()  # Class variable, in-memory only

Impact

  1. Rate limit state is not shared across multiple server instances/workers — an attacker can distribute attempts
  2. All rate limit state is lost on server restart — allows immediate retry
  3. In multi-worker deployments, each worker has independent rate limit state

Recommended Fix

  • Use Redis or the database for rate limit state storage
  • Or use a shared-memory approach for multi-worker deployments
  • At minimum, persist lockout state to survive restarts

Fix

Fixed in commit 2749bc0 on branch releases/1.4.x — added abstract RateLimitBackend with InMemoryBackend and DatabaseBackend implementations; defaults to DatabaseBackend when DB available.

Database specific
{
    "nvd_published_at": null,
    "severity": "CRITICAL",
    "github_reviewed": true,
    "cwe_ids": [
        "CWE-770"
    ],
    "github_reviewed_at": "2026-03-31T23:41:26Z"
}
References

Affected packages

PyPI / openssl-encrypt

Package

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0Unknown introduced version / All previous versions are affected
Fixed
1.4.0

Affected versions

0.*
0.2.2
0.2.3
0.2.4
0.2.5
0.2.6
0.3.0
0.3.1
0.3.2
0.3.3
0.4.0
0.4.1
0.4.2
0.4.3
0.4.4
0.5.0
0.5.1
0.5.3
0.6.0rc1
0.7.0rc2
0.7.1
0.7.2
0.8.0
0.8.1
0.8.2
0.9.2
1.*
1.0.0
1.0.1
1.0.2
1.0.3
1.1.0
1.2.0
1.2.1
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.3.5
1.4.0b3
1.4.0b4
1.4.0b5
1.4.0b6
1.4.0b7
1.4.0b8

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/03/GHSA-h45m-mgcp-q388/GHSA-h45m-mgcp-q388.json"