Skip to content

Commit 092387f

Browse files
Potential fix for code scanning alert no. 187: SQL query built from user-controlled sources (#678)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 6bd7c24 commit 092387f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/vr/assets/web/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -429,8 +429,10 @@ def remove_cicd_pipeline():
429429
return render_template('403.html', user=user, NAV=NAV)
430430

431431
pipeline_id = request.form.get('pipeline_id')
432+
if not pipeline_id.isdigit():
433+
return render_template('400.html'), 400
432434
del_pair = CICDPipelines.query\
433-
.filter(text(f"CICDPipelines.ID={pipeline_id}")).first()
435+
.filter(CICDPipelines.ID == pipeline_id).first()
434436
if del_pair:
435437
db.session.delete(del_pair)
436438
db_connection_handler(db)

0 commit comments

Comments
 (0)