mirror of
https://github.com/fiatjaf/khatru.git
synced 2026-04-26 23:08:05 +02:00
fix: QueryEvents should skip ids that are not a valid 32 byte hex
This commit is contained in:
@@ -32,7 +32,7 @@ func (b PostgresBackend) QueryEvents(filter *nostr.Filter) (events []nostr.Event
|
||||
// to prevent sql attack here we will check if
|
||||
// these ids are valid 32byte hex
|
||||
parsed, err := hex.DecodeString(id)
|
||||
if err != nil || len(parsed) <= 32 {
|
||||
if err != nil || len(parsed) != 32 {
|
||||
continue
|
||||
}
|
||||
likeids = append(likeids, fmt.Sprintf("id LIKE '%x%%'", parsed))
|
||||
|
||||
Reference in New Issue
Block a user