KOSASIH / ExoGenesis

Audit required: Risk of possible SQL injection vector through string-based query construction BAN-B608
Security
Major
3 months ago3 months old
Possible SQL injection vector through string-based query construction.
11    work_item_client = connection.clients.get_work_item_tracking_client()
12
13    # Define the query to retrieve the desired work items
14    wiql = Wiql(query=f"SELECT * FROM WorkItems WHERE [System.TeamProject] = '{project_name}' AND [System.Id] IN (SELECT [Id] FROM WorkItemLinks WHERE [Source].[System.Id] IN ({query_id}))")15
16    # Run the query and get the results
17    query_results = work_item_client.query_by_wiql(wiql).work_items