Miggo Logo

CVE-2012-4571: Python Keyring does not securely initialize encryption cipher

7.5

CVSS Score
3.1

Basic Information

EPSS Score
0.20662%
Published
5/17/2022
Updated
9/27/2024
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
Package NameEcosystemVulnerable VersionsFirst Patched Version
keyringpip<= 0.9.10.9.2

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from how CryptedFileKeyring handled encryption:

  1. _init_crypter used the raw password (padded to 32 bytes) as the AES key without proper key derivation.
  2. AES.MODE_CFB was initialized with an implicit zero IV (no randomness).
  3. No salt was used in key generation, allowing rainbow table attacks.
  4. The commit 162f2ed replaced these with PBKDF2 for key derivation and random IVs, confirming the weakness in the original implementation. The encrypt/decrypt methods directly utilized this flawed initialization, making them vulnerable entry points.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

Pyt*on K*yrin* *.*.* *o*s not s**ur*ly initi*liz* t** *ip**r w**n *n*ryptin* p*sswor*s *or `*rypt***il*K*yrin*` *il*s, w*i** m*k*s it **si*r *or lo**l us*rs to o*t*in p*sswor*s vi* * *rut*-*or** *tt**k.

Reasoning

T** vuln*r**ility st*ms *rom *ow *rypt***il*K*yrin* **n*l** *n*ryption: *. _init_*rypt*r us** t** r*w p*sswor* (p***** to ** *yt*s) *s t** **S k*y wit*out prop*r k*y **riv*tion. *. **S.MO**_*** w*s initi*liz** wit* *n impli*it z*ro IV (no r*n*omn*ss)