CVE-2023-34233
📋 TL;DR
The Snowflake Connector for Python versions before 3.0.2 are vulnerable to command injection through SSO browser URL authentication. An attacker can set up a malicious server and trick users into visiting a crafted connection URL, potentially leading to remote code execution on the user's machine. This affects any Python application using vulnerable versions of the Snowflake Connector.
💻 Affected Systems
- Snowflake Connector for Python
📦 What is this software?
⚠️ Risk & Real-World Impact
Worst Case
Remote code execution on the user's local machine, allowing full system compromise, data theft, and lateral movement within the network.
Likely Case
Limited code execution in the context of the Snowflake Connector process, potentially leading to credential theft, data exfiltration, or further exploitation.
If Mitigated
No impact if URL whitelisting and anti-phishing controls prevent users from accessing malicious URLs.
🎯 Exploit Status
Exploitation requires social engineering to trick users into visiting malicious URLs and setting up a malicious server.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 3.0.2
Vendor Advisory: https://github.com/snowflakedb/snowflake-connector-python/security/advisories/GHSA-5w5m-pfw9-c8fp
Restart Required: No
Instructions:
1. Update Snowflake Connector for Python to version 3.0.2 or later using pip: pip install --upgrade snowflake-connector-python>=3.0.2
2. Verify the update was successful by checking the version.
🔧 Temporary Workarounds
URL Whitelisting
allRestrict SSO authentication to trusted URLs only through network or application controls.
Disable SSO Browser Authentication
allUse alternative authentication methods like username/password or key pair authentication instead of SSO browser URL authentication.
🧯 If You Can't Patch
- Implement strict URL filtering and whitelisting for SSO authentication endpoints.
- Train users to recognize phishing attempts and avoid clicking on untrusted connection URLs.
🔍 How to Verify
Check if Vulnerable:
Check the installed version of snowflake-connector-python using pip show snowflake-connector-python or python -c "import snowflake.connector; print(snowflake.connector.__version__)"
Check Version:
python -c "import snowflake.connector; print(snowflake.connector.__version__)"
Verify Fix Applied:
Confirm the version is 3.0.2 or higher using the same commands.
📡 Detection & Monitoring
Log Indicators:
- Unusual SSO authentication attempts from unexpected IPs or domains
- Errors or anomalies in Snowflake connector logs related to URL processing
Network Indicators:
- Outbound connections to unknown or suspicious domains during SSO authentication
SIEM Query:
source="snowflake_connector" AND (url="*malicious*" OR url="*suspicious*")
🔗 References
- https://github.com/snowflakedb/snowflake-connector-python/commit/1cdbd3b1403c5ef520d7f4d9614fe35165e101ac
- https://github.com/snowflakedb/snowflake-connector-python/pull/1480
- https://github.com/snowflakedb/snowflake-connector-python/security/advisories/GHSA-5w5m-pfw9-c8fp
- https://github.com/snowflakedb/snowflake-connector-python/commit/1cdbd3b1403c5ef520d7f4d9614fe35165e101ac
- https://github.com/snowflakedb/snowflake-connector-python/pull/1480
- https://github.com/snowflakedb/snowflake-connector-python/security/advisories/GHSA-5w5m-pfw9-c8fp