KOSASIH / SilkRoad

Audit required: Risk of possible SQL injection vector through string-based query construction BAN-B608
Security
Major
5 months ago5 months old
Possible SQL injection vector through string-based query construction.
 78
 79    # Sort the products based on the given sorting criteria
 80    cursor.execute(
 81        "SELECT id, name, description FROM products ORDER BY " + order_clause 82    )
 83    products = [row for row in cursor.fetchall()]
 84
Possible SQL injection vector through string-based query construction.
 44
 45    # Filter the products based on the given filters
 46    cursor.execute(
 47        "SELECT id, name, description FROM products WHERE " + where_clause, 48        tuple(filter_value.values()),
 49    )
 50    products = [row for row in cursor.fetchall()]