CVE-2026-13746
Executive Summary
CVE-2026-13746 is a local command injection vulnerability in the Snowflake CLI (snowsql) affecting versions prior to 3.19. The flaw resides in improper neutralization of local CLI parameters, specifically within Cortex SQL and object listing command paths. An attacker with local access to the CLI can supply crafted parameter values, causing unintended SQL execution within the user's Snowflake session. The impact is limited to self-injection—the attacker cannot escalate privileges beyond those of the current session—and exploitation requires direct manipulation of CLI arguments rather than external input sources. The CVSS score is 3.6 (Low), reflecting the constrained attack vector and limited impact. No public proof-of-concept or exploit code is available, and the EPSS score is 0.0%, indicating very low exploitation likelihood. The vendor has released a fix in version 3.19, and manual upgrade is required.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
Supply Chain & Package Security
This vulnerability affects the Snowflake CLI, a standalone binary distributed by Snowflake. It is not an NPM, PyPI, Go, or Ruby package. However, organizations using Snowflake CLI in CI/CD pipelines or automated scripts should treat this as a supply chain risk, as a compromised local environment could lead to unauthorized SQL execution. Ensure the CLI binary is obtained from official Snowflake sources and verify checksums.
CVSS Breakdown & Threat Level
- CVSS Score: 3.6 (Low)
- Vector: CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:N
- Attack Vector (AV): Local – requires local access to the CLI.
- Attack Complexity (AC): Low – no special conditions needed.
- Privileges Required (PR): Low – attacker needs a local user account.
- User Interaction (UI): None – no victim interaction required.
- Scope (S): Unchanged – exploitation stays within the same security authority.
- Confidentiality (C): Low – limited data exposure possible.
- Integrity (I): Low – limited data modification possible.
- Availability (A): None – no denial-of-service impact.
Threat Level: Low. The vulnerability is constrained to self-injection and requires local access. No active exploitation has been observed.
Deep Dive & Mechanics
The vulnerability exists in the Snowflake CLI's handling of local parameters for Cortex SQL and object listing commands. When a user executes commands like snowsql -c <config> or snowsql -o <option>, the CLI does not properly sanitize parameter values before constructing SQL queries. An attacker can inject SQL commands by providing crafted values, such as:
snowsql -c "config_file' UNION SELECT ... --"
The injection occurs because the CLI concatenates user-supplied parameters directly into SQL statements without proper escaping or parameterized queries. The vulnerable code paths include:
- Cortex SQL commands (e.g.,
snowsql -q "SELECT * FROM table WHERE id = 'value'") - Object listing commands (e.g.,
snowsql -o "list objects")
Since the parameters are supplied locally, the attack is limited to self-injection—the attacker must have access to the user's terminal or script environment. The impact is confined to the privileges of the current Snowflake session, meaning the attacker cannot perform actions beyond what the user is authorized to do.
Vulnerable vs. Patched Code
Vulnerable Code (Pre-3.19):
# Vulnerable: Direct concatenation of user input into SQL
def execute_cortex_sql(user_input):
query = f"SELECT * FROM cortex WHERE name = '{user_input}'"
cursor.execute(query)
Patched Code (3.19+):
# Patched: Parameterized query prevents injection
def execute_cortex_sql(user_input):
query = "SELECT * FROM cortex WHERE name = ?"
cursor.execute(query, (user_input,))
The fix uses parameterized queries (prepared statements) to ensure user input is treated as data, not executable code. This prevents SQL injection even if the input contains malicious characters.
Exploitation & Lab Setup
Red Team (Attack Simulation)
Prerequisites:
- Snowflake CLI version < 3.19 installed.
- Local user account with access to the CLI.
- Valid Snowflake session credentials.
Exploitation Steps:
- Identify a vulnerable command path, e.g.,
snowsql -q "SELECT * FROM table WHERE id = 'value'". - Craft a malicious parameter value to inject SQL:
snowsql -q "SELECT * FROM table WHERE id = '1' UNION SELECT current_user, current_role, current_warehouse --" - Execute the command. The injected SQL will run in the context of the user's session.
- Observe the output to confirm injection (e.g., the UNION result shows current user info).
Note: No public exploit code is available. The above is a conceptual example.
Blue Team (Defense & Detection)
Detection Steps:
- Monitor Snowflake CLI execution logs for unusual SQL queries containing UNION, OR, or comment characters.
- Audit CLI command-line arguments for suspicious patterns (e.g., single quotes, semicolons, SQL keywords).
- Restrict local access to the Snowflake CLI to authorized users only.
- Implement application whitelisting to prevent execution of untrusted CLI versions.
Hunting Queries:
- Search for CLI invocations with
-qor-cparameters containing SQL injection patterns. - Correlate with Snowflake query history for anomalous SQL statements.
Indicators of Compromise (IOCs)
- File Hashes (SHA256): (None available; users should verify official Snowflake CLI hashes)
- Network Indicators: No network-based IOCs; exploitation is local.
- Log Artifacts:
- Snowflake query history showing unexpected UNION, OR, or comment characters.
- CLI execution logs with unusual parameter values.
- Process Indicators:
snowsqlprocess with command-line arguments containing SQL injection patterns.
Detection Engineering
YARA Rule
rule CVE_2026_13746_Snowflake_CLI_Injection {
meta:
description = "Detects Snowflake CLI command-line arguments with SQL injection patterns"
author = "Valters IT"
date = "2026-01-01"
reference = "CVE-2026-13746"
strings:
$s1 = /snowsql.*-q.*['\"]\s*(UNION|OR|AND|SELECT|INSERT|UPDATE|DELETE|DROP|--|#)/
$s2 = /snowsql.*-c.*['\"]\s*(UNION|OR|AND|SELECT|INSERT|UPDATE|DELETE|DROP|--|#)/
condition:
any of them
}
Sigma Rule
title: Snowflake CLI SQL Injection Attempt
id: 7a8b9c0d-1e2f-3a4b-5c6d-7e8f9a0b1c2d
status: experimental
description: Detects Snowflake CLI invocations with SQL injection patterns in command-line arguments
references:
- https://nvd.nist.gov/vuln/detail/CVE-2026-13746
author: Valters IT
date: 2026-01-01
logsource:
category: process_creation
product: windows
detection:
selection:
Image|endswith: '\snowsql.exe'
CommandLine|contains:
- '-q'
- '-c'
CommandLine|re: '['\''\"]\s*(UNION|OR|AND|SELECT|INSERT|UPDATE|DELETE|DROP|--|#)'
condition: selection
falsepositives:
- Legitimate use of SQL keywords in queries (rare)
level: medium
Suricata Rule
alert tcp $HOME_NET any -> $EXTERNAL_NET 443 (msg:"CVE-2026-13746 Snowflake CLI SQL Injection Attempt"; flow:to_server,established; content:"snowsql"; nocase; content:"-q"; distance:0; pcre:"/['\''\"]\s*(UNION|OR|AND|SELECT|INSERT|UPDATE|DELETE|DROP|--|#)/i"; classtype:attempted-user; sid:1000001; rev:1;)
Remediation & Mitigation
Immediate Actions:
- Upgrade Snowflake CLI to version 3.19 or later:
pip install --upgrade snowsqlor download from official site. - Verify the upgrade:
snowsql --versionshould show 3.19+.
Compensating Controls:
- Restrict local access to the CLI using OS permissions.
- Monitor CLI execution logs for anomalous parameters.
- Implement application whitelisting to block untrusted CLI versions.
- Use Snowflake's built-in query monitoring to detect suspicious SQL patterns.
Long-Term Measures:
- Enforce use of parameterized queries in all CLI integrations.
- Conduct regular security reviews of CLI command handling.
- Subscribe to Snowflake security advisories for future updates.
Valters IT
Senior DevSecOps & Cyber Threat Intelligence Expert