Skip to content

Commit

Permalink
🔒 SQL injection security vulnerabilities #13077 #13057
Browse files Browse the repository at this point in the history
  • Loading branch information
88250 committed Nov 7, 2024
1 parent ed33718 commit 06c3977
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/model/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,6 +448,13 @@ func FullTextSearchHistoryItems(created, query, box, op string, typ int) (ret []
table := "histories_fts_case_insensitive"
stmt := "SELECT * FROM " + table + " WHERE "
stmt += buildSearchHistoryQueryFilter(query, op, box, table, typ)

_, parseErr := strconv.Atoi(created)
if nil != parseErr {
ret = []*HistoryItem{}
return
}

stmt += " AND created = '" + created + "' ORDER BY created DESC LIMIT " + fmt.Sprintf("%d", fileHistoryPageSize)
sqlHistories := sql.SelectHistoriesRawStmt(stmt)
ret = fromSQLHistories(sqlHistories)
Expand Down

0 comments on commit 06c3977

Please sign in to comment.