sql-server-table-reconciliation

Warn

Audited by Gen Agent Trust Hub on Sep 20, 2026

Risk Level: MEDIUMCOMMAND_EXECUTIONINDIRECT_PROMPT_INJECTION
Full Analysis
  • [COMMAND_EXECUTION]: The scripts/reconcile.py script is vulnerable to SQL injection. In the extract_table and extract_hashes functions, the code uses f-string interpolation to insert the table name and pk_cols directly into SQL query strings (e.g., f"SELECT * FROM {table} ORDER BY {pk_order}"). Since these values are derived from user-controllable arguments (--tables and --primary-key), a malicious actor could provide crafted inputs to execute arbitrary SQL commands on the target database servers.
  • [COMMAND_EXECUTION]: The connection string construction in the connect function is vulnerable to Connection String Injection. The script uses f-strings to build the connection string (f"Server={server};Database={database};UID={user};PWD={password};...") without sanitizing the input variables. A malicious input containing semicolons could be used to inject or override connection parameters, such as disabling encryption or redirecting the connection.
  • [INDIRECT_PROMPT_INJECTION]: The skill has a vulnerability surface for indirect prompt injection via malicious database metadata.
  • Ingestion points: Table names and primary key specifications provided via command-line arguments in scripts/reconcile.py, as well as metadata retrieved from INFORMATION_SCHEMA.COLUMNS.
  • Boundary markers: None. There are no delimiters or instructions provided to the script to treat these inputs as untrusted data.
  • Capability inventory: The script has the capability to connect to remote SQL Server instances and execute arbitrary queries using the mssql-python driver.
  • Sanitization: None. The script fails to sanitize table or column identifiers and specifically violates the safety guidance provided in the SKILL.md file, which explicitly states to "never f-string interpolate user input into SQL."
Audit Metadata
Risk Level
MEDIUM
Analyzed
Sep 20, 2026, 05:57 PM