GHSA-h45m-mgcp-q388: openssl-encrypt TOTP Rate Limiter Is In-memory Vulnerability
CRITICALGHSA-h45m-mgcp-q388 is a CRITICAL totp rate limiter is in-memory vulnerability (CWE-770: Allocation of Resources Without Limits or Throttling) affecting openssl-encrypt libraries in the PyPI ecosystem. The issue involves totp rate limiter is in-memory only — not shared across workers, lost on restart. Remediation is available by upgrading affected packages to version 1.4.0.
GHSA-h45m-mgcp-q388 at a Glance
How to Fix GHSA-h45m-mgcp-q388
To remediate this vulnerability, upgrade all affected openssl-encrypt dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
pip install openssl-encrypt>=1.4.0
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
pip show openssl-encrypt
How to Check if You Are Affected
To determine whether your Python environment is affected by GHSA-h45m-mgcp-q388, inspect your installed packages using pip:
pip show openssl-encrypt
Analyze the terminal output to locate any version of openssl-encrypt in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.4.0), your application is affected.
Note: The pip show openssl-encrypt command checks currently installed packages in your active Python environment.
Technical Details
Vulnerability Mechanism & Technical Analysis
This vulnerability is classified under CWE-770: Allocation of Resources Without Limits or Throttling, where the product allocates a reusable resource or group of resources on behalf of an actor without imposing any intended restrictions on the size or number of resources that can be allocated. In openssl-encrypt, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.
Source Advisory Statement
GHSA-h45m-mgcp-q388 Affected openssl-encrypt Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
openssl-encrypt
|
PyPI |
< 1.4.0
|
1.4.0
|
References
Frequently Asked Questions
What is GHSA-h45m-mgcp-q388?
Which openssl-encrypt versions are affected?
What version fixes GHSA-h45m-mgcp-q388?
Is openssl-encrypt affected?
What CWE is associated with GHSA-h45m-mgcp-q388?
How can I check PyPI dependencies for GHSA-h45m-mgcp-q388?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-h45m-mgcp-q388",
"modified" : "2026-03-31T23:41:26Z",
"published" : "2026-03-31T23:41:26Z",
"aliases" : [ ],
"summary" : "openssl-encrypt: TOTP rate limiter is in-memory only — not shared across workers, lost on restart",
"details" : "## 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.",
"severity" : [ {
"type" : "CVSS_V4",
"score" : "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"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "PyPI",
"name" : "openssl-encrypt"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "0"
}, {
"fixed" : "1.4.0"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jahlives/openssl_encrypt/security/advisories/GHSA-h45m-mgcp-q388"
}, {
"type" : "WEB",
"url" : "https://github.com/jahlives/openssl_encrypt/commit/2749bc0949b34a5921a35fb4a3f1856fc51916de"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/jahlives/openssl_encrypt"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-770" ],
"severity" : "CRITICAL",
"github_reviewed" : true,
"github_reviewed_at" : "2026-03-31T23:41:26Z",
"nvd_published_at" : null
}
}