mirror of
https://github.com/fiatjaf/khatru.git
synced 2025-03-26 17:51:49 +01:00
fix: QueryEvents should skip ids that are not a valid 32 byte hex
This commit is contained in:
parent
f2ab8020a8
commit
af890590f3
@ -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))
|
||||
|
Loading…
x
Reference in New Issue
Block a user