
Proof-of-concept demonstrating CVE-2025-24793 SQL injection vulnerability in Snowflake Connector for Python, with auto-detection of patched/unpatched versions for security testing.
This repository contains Proof of Concept (PoC) code for testing CVE-2025-24793 vulnerability in Snowflake Connector for Python. The project includes both patched and unpatched versions to demonstrate the vulnerability and its fix.
├── Dockerfile # Docker configuration
├── requirements.txt # Python dependencies
├── config.toml # Snowflake connection configuration (you need to create this)
├── cve_2025_24793_poc.py # Main PoC script (auto-detects patched/unpatched)
├── snowflake_app.py # Main application
└── snowflake_connector_python-2.9.0-py3-none-any.whl # Snowflake connector wheel
Simply replace snowflake_connector_python-2.9.0-py3-none-any.whl with your build:
The PoC script will automatically detect which version you're using.
Create a Snowflake Account:
abc123.us-east-1)Create config.toml file:
Create a config.toml file in the root directory with your Snowflake credentials:
[connections.my_example_connection]
account = "your_account_identifier" # e.g., "abc123.us-east-1"
user = "your_username" # Your Snowflake username
password = "your_password" # Your Snowflake password
role = "your_role" # e.g., "ACCOUNTADMIN" or "SYSADMIN"
warehouse = "your_warehouse" # e.g., "COMPUTE_WH"
database = "your_database" # e.g., "TESTDB"
schema = "your_schema" # e.g., "PUBLIC"
Example configuration:
[connections.my_example_connection]
account = "abc123.us-east-1"
user = "testuser"
password = "MySecurePassword123!"
role = "ACCOUNTADMIN"
warehouse = "COMPUTE_WH"
database = "TESTDB"
schema = "PUBLIC"
Build Docker image:
docker build -t <container_name> .
Run Docker container:
docker run --rm <container_name>
Testing with any build:
# 1. Replace wheel with your patched or unpatched version
# 2. Build and run - the script will auto-detect the version
docker build -t snowflake-test .
docker run --rm snowflake-test
The PoC will automatically:
This vulnerability affects the Snowflake Connector for Python and involves SQL injection through the write_pandas function.
The PoC script automatically detects and demonstrates:
The script inspects the write_pandas function to determine if the vulnerable stage_location parameter is present, providing clear feedback on the security status.
⚠️ Security Warning: This is a proof-of-concept for educational and testing purposes only. Do not use in production environments.
⚠️ Configuration Security: Never commit your config.toml file with real credentials to version control. Add it to .gitignore.
⚠️ Snowflake Costs: Be aware that running these tests may consume Snowflake compute credits.
config.tomlrequirements.txt