CVE-2025-24794: snowflake-connector-python vulnerable to insecure deserialization of the OCSP response cache
6.7
Basic Information
Technical Details
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
snowflake-connector-python | pip | >= 2.7.12, <= 3.13.0 | 3.13.1 |
Vulnerability Intelligence
Miggo AI
Root 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
.
- The
_load
method previously contained the lineother: SFDictFileCache = pickle.load(r_file)
. This is a direct use ofpickle.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. - The
_save
method previously contained the linew_file.write(pickle.dumps(self))
. This method serialized the cache object usingpickle.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.