Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

Use ? for IN clause to fix "Database query built from user-controlled sources"

天舟44a6c44cb7c6
diff --git a/store/issue.go b/store/issue.go
index e9b9af077f..4bd4eda335 100644
--- a/store/issue.go
+++ b/store/issue.go
@@ -205,7 +205,8 @@ func (s *IssueService) findIssueList(ctx context.Context, tx *Tx, find *api.Issu
if v := find.StatusList; v != nil {
list := []string{}
for _, status := range *v {
- list = append(list, fmt.Sprintf("'%s'", status))
+ list = append(list, "?")
+ args = append(args, status)
}
where = append(where, fmt.Sprintf("`status` in (%s)", strings.Join(list, ",")))
}