Skip to content

harden: add parameterized queries in queues.py - #1021

Open
anupamme wants to merge 1 commit into
NationalGenomicsInfrastructure:masterfrom
anupamme:fix-repo-genomics-status-queues-sql-injection-format-placeholders
Open

harden: add parameterized queries in queues.py#1021
anupamme wants to merge 1 commit into
NationalGenomicsInfrastructure:masterfrom
anupamme:fix-repo-genomics-status-queues-sql-injection-format-placeholders

Conversation

@anupamme

Copy link
Copy Markdown

Summary

Harden input handling in status/queues.py (flagged by multi_agent_ai).

Vulnerability

Field Value
ID V-001
Severity CRITICAL
Scanner multi_agent_ai
Rule V-001
File status/queues.py:102
Assessment Defensive hardening
CWE CWE-89
Chain Complexity 2-step

Description: The status/queues.py file contains multiple SQL queries constructed using string formatting with format() placeholders. While the formatted values originate from internal database configuration rather than direct user input, this pattern creates potential for SQL injection if the configuration is compromised or if the code is modified in the future. The queries at lines 102-115 and 245-250 use format() placeholders for protocolid and stepid values.

Threat Model Context

This is a web service - vulnerabilities in request handlers are directly exploitable by remote attackers.

Changes

  • status/queues.py

Behavior Preservation

The change is scoped to 1 file on the vulnerable path; it only tightens handling of untrusted input and leaves valid inputs unaffected.


This patch removes an exploit primitive — a code pattern that, while not independently exploitable today, could be chained with other weaknesses by automated exploit-development tooling. Proactive removal of such primitives raises the bar against increasingly capable automated attack tools.


Automated security fix by OrbisAI Security

Automated security fix generated 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