cxnleach / Vuln_GO_App

MIT License
0 stars 0 forks source link

CX SQL_Injection @ vulnerable/sql.go [master] #18

Open github-actions[bot] opened 1 month ago

github-actions[bot] commented 1 month ago

SQL_Injection issue exists @ vulnerable/sql.go in branch master

*The application's GetProducts method executes an SQL query with QueryContext, at line 69 of vulnerable\sql.go. The application constructs this SQL query by embedding an untrusted string into the query without proper sanitization. The concatenated string is submitted to the database, where it is parsed and executed accordingly.An attacker would be able to inject arbitrary syntax and data into the SQL query, by crafting a malicious payload and providing it via the input ctx; this input is then read by the GetProducts method at line 68 of vulnerable\sql.go. This input then flows through the code, into a query and to the database server - without sanitization.This may enable an SQL Injection attack.Similarity ID: 303440817

The application's GetProducts method executes an SQL query with QueryContext, at line 69 of vulnerable\sql.go. The application constructs this SQL query by embedding an untrusted string into the query without proper sanitization. The concatenated string is submitted to the database, where it is parsed and executed accordingly.An attacker would be able to inject arbitrary syntax and data into the SQL query, by crafting a malicious payload and providing it via the input db; this input is then read by the GetProducts method at line 68 of vulnerable\sql.go. This input then flows through the code, into a query and to the database server - without sanitization.This may enable an SQL Injection attack.Similarity ID: -522360844

The application's GetProducts method executes an SQL query with QueryContext, at line 69 of vulnerable\sql.go. The application constructs this SQL query by embedding an untrusted string into the query without proper sanitization. The concatenated string is submitted to the database, where it is parsed and executed accordingly.An attacker would be able to inject arbitrary syntax and data into the SQL query, by crafting a malicious payload and providing it via the input category; this input is then read by the GetProducts method at line 68 of vulnerable\sql.go. This input then flows through the code, into a query and to the database server - without sanitization.This may enable an SQL Injection attack.Similarity ID: -1348162505*

Severity: High

CWE:89

Vulnerability details and guidance

Internal Guidance

Checkmarx

Training Recommended Fix

Lines: 68


Code (Line #68):

func GetProducts(ctx context.Context, db *sql.DB, category string) ([]Product, error) {

github-actions[bot] commented 1 month ago

Issue still exists.