Searching items for % or _ matches more than was typed #296

Closed
opened 2026-10-19 10:40:17 -07:00 by rays · 1 comment
Owner

entries_from (crates/ipx/src/db.rs:1225) puts the search term into a LIKE pattern without escaping % and _, so a search for '100%' or 'a_b' treats them as wildcards. Found in a repo audit. Fix: escape them and add ESCAPE '\', which works on SQLite and Postgres.

entries_from (crates/ipx/src/db.rs:1225) puts the search term into a LIKE pattern without escaping % and _, so a search for '100%' or 'a_b' treats them as wildcards. Found in a repo audit. Fix: escape them and add ESCAPE '\\', which works on SQLite and Postgres.
rays added the bug label 2026-10-19 10:40:17 -07:00
Author
Owner

Fixed in 44afc08: the search term's , % and _ are escaped and both LIKEs say ESCAPE '', on SQLite and Postgres. every_filter_works_with_and_without_a_search_term checks that each finds nothing in items without it. Deployed in ipx.

Fixed in 44afc08: the search term's \, % and _ are escaped and both LIKEs say ESCAPE '\', on SQLite and Postgres. every_filter_works_with_and_without_a_search_term checks that each finds nothing in items without it. Deployed in ipx.
rays closed this issue 2026-10-19 11:17:40 -07:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#296