Miggo Logo

CVE-2025-24794: snowflake-connector-python vulnerable to insecure deserialization of the OCSP response cache

6.7

CVSS Score
3.1

Basic Information

EPSS Score
0.24512%
Published
1/29/2025
Updated
4/9/2025
KEV Status
No
Technology
TechnologyPython

Technical Details

CVSS Vector
CVSS:3.1/AV:L/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H
Package NameEcosystemVulnerable VersionsFirst Patched Version
snowflake-connector-pythonpip>= 2.7.12, <= 3.13.03.13.1

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability description states that the OCSP response cache used pickle for serialization, leading to potential local privilege escalation. The provided commit 3769b43822357c3874c40f5e74068458c2dc79af shows changes primarily in src/snowflake/connector/cache.py and src/snowflake/connector/ocsp_snowflake.py.

In src/snowflake/connector/cache.py, the SFDictFileCache class had methods _load and _save.

  1. The _load method previously contained the line other: SFDictFileCache = pickle.load(r_file). This is a direct use of pickle.load on a file, which is the core of the deserialization vulnerability. If an attacker could control the content of this file, they could achieve arbitrary code execution.
  2. The _save method previously contained the line w_file.write(pickle.dumps(self)). This method serialized the cache object using pickle.dumps before writing it to a file. This serialized data would then be consumed by the vulnerable _load method.

The patch replaces these direct pickle calls with self._deserialize and self._serialize respectively. A new class _OCSPResponseValidationResultCache (in src/snowflake/connector/ocsp_snowflake.py), which inherits from SFDictFileCache, overrides these methods to use json for serialization and deserialization, thus mitigating the vulnerability. The OCSP_RESPONSE_VALIDATION_CACHE is then instantiated using this new, safer class.

The functions SFDictFileCache._load and SFDictFileCache._save are identified as vulnerable because they were the ones directly performing the insecure pickle.load and pickle.dumps operations on the cache file before the patch.

Vulnerable functions

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

WAF Protection Rules

WAF Rule

### Issu* Snow*l*k* *is*ov*r** *n* r*m**i*t** * vuln*r**ility in t** Snow*l*k* *onn**tor *or Pyt*on. T** O*SP r*spons* ***** us*s pi*kl* *s t** s*ri*liz*tion *orm*t, pot*nti*lly l***in* to lo**l privil*** *s**l*tion. T*is vuln*r**ility *****ts v*rsi

Reasoning

T** vuln*r**ility **s*ription st*t*s t**t t** O*SP r*spons* ***** us** `pi*kl*` *or s*ri*liz*tion, l***in* to pot*nti*l lo**l privil*** *s**l*tion. T** provi*** *ommit `****************************************` s*ows ***n**s prim*rily in `sr*/snow*l*