subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
"-c", f"SELECT title, content FROM memory_structured {where};" ] result = subprocess.run(cmd, capture_output=True, text=True) return result.stdout def search_vector(query):- Confidence
- 95% confidence
- Finding
- This subprocess call executes `psql` with a SQL string built from untrusted input (`category`) via string interpolation. Although `shell=False` avoids shell injection, this is still a command-driven SQL injection path because attacker-controlled data is passed into `psql -c`, allowing arbitrary SQL execution against the database.
