Skip to content

fix: add parameterized queries in import-legacy.ts - #285

Open
anupamme wants to merge 1 commit into
HotKids:masterfrom
anupamme:fix-repo-rules-v-001-snell-panel-scripts-import-legacy-ts
Open

fix: add parameterized queries in import-legacy.ts#285
anupamme wants to merge 1 commit into
HotKids:masterfrom
anupamme:fix-repo-rules-v-001-snell-panel-scripts-import-legacy-ts

Conversation

@anupamme

@anupamme anupamme commented Sep 5, 2026

Copy link
Copy Markdown

Summary

Fix critical severity security issue in snell-panel/scripts/import-legacy.ts.

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File snell-panel/scripts/import-legacy.ts:27
Assessment Likely exploitable
CWE CWE-89

Description: The import-legacy.ts script constructs SQL INSERT statements using string concatenation with values derived from external API responses. The script fetches data from a user-provided URL and directly interpolates the response data into SQL statements without parameterization. While a simple quote-escaping function (s()) is used, it is insufficient protection against all SQL injection techniques.

Evidence

Exploitation scenario: An attacker who controls the legacy panel API or can perform a man-in-the-middle attack on the connection can inject malicious SQL payloads through any string field (node_id, node_name, psk,.

Scanner confirmation: multi_agent_ai rule V-001 flagged this pattern.

Changes

  • snell-panel/scripts/import-legacy.ts

Behavior Preservation

The change is scoped to 1 file on the vulnerable path.


Automated security fix by OrbisAI Security

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant