-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Open
Description
AgentAudit Security Audit Report
| Metric | Value |
|---|---|
| Package | mcp-server-sqlite |
| Version | 2025.4.25 |
| Risk Score | 25/100 |
| Result | safe |
| Findings | 1 total (1 critical, 0 high, 0 medium, 0 low) |
Findings Summary
| Severity | Title | File:Line |
|---|---|---|
| Critical | SQL injection in describe_table via f-string | mcp_server_sqlite/server.py:326 |
Details
SQL Injection in describe_table Tool
The describe_table tool constructs a SQL query using f-string interpolation without sanitizing the table_name parameter:
results = db._execute_query(
f"PRAGMA table_info({arguments['table_name']})"
)Attack Vector:
An attacker could provide a crafted table_name such as:
users); DROP TABLE users; --users); SELECT * FROM sqlite_master; --
This would execute arbitrary SQL commands.
Recommendation:
- Validate
table_nameagainst the list of existing tables before using it - Use parameterized queries where possible
- Sanitize the input to only allow alphanumeric characters and underscores
Example Fix:
# Get list of valid tables first
valid_tables = db._execute_query("SELECT name FROM sqlite_master WHERE type='table'")
table_names = [row['name'] for row in valid_tables]
if arguments['table_name'] not in table_names:
raise ValueError(f"Table '{arguments['table_name']}' does not exist")
# Now safe to use
results = db._execute_query(f"PRAGMA table_info({arguments['table_name']})")Full Report
View the complete audit report with details, evidence, and remediation guidance:
AgentAudit Report
This audit was performed automatically by AgentAudit, the security registry for AI agent packages. If you believe any finding is incorrect, you can dispute it on the platform.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels