Skip to content

Commit 5b148d8

Browse files
authored
Merge pull request #6861 from devtron-labs/dep-bot-sec-12nov-1
fix: sql injection
2 parents dd1c332 + fe8324a commit 5b148d8

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/policyGovernance/security/imageScanning/repository/ImageScanDeployInfoRepository.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,9 @@ func (impl ImageScanDeployInfoRepositoryImpl) scanListQueryWithObject(request *r
241241
query = query + ` INNER JOIN environment env on env.id=info.env_id
242242
INNER JOIN cluster c on c.id=env.cluster_id
243243
WHERE info.scan_object_meta_id > 0 and env.active=true and info.image_scan_execution_history_id[1] != -1
244-
AND a.app_name like '%` + request.AppName + `%' `
244+
AND a.app_name like ? `
245+
246+
queryParams = append(queryParams, util.GetLIKEClauseQueryParam(request.AppName))
245247

246248
if len(deployInfoIds) > 0 {
247249
query += " AND info.id IN (?) "

0 commit comments

Comments
 (0)