Skip to content

Typing spaces, quotes, or other special characters into the Linked Items search box produces an invalid query; potential query injection? #1808

@coderbot16

Description

@coderbot16

Typing something like Test File into the "Linked items" query box produced an Invalid Query error. When I looked into the issue, it seems like the input is getting directly substituted into a database query without any escaping. This means that typing * id: into the Linked Items search will actually cause the following query to be dispatched:

(& !id~=3kQwbmamtfd-bfSVXMUZZyp-KwcFu218jcJ-vnvqk4maXnS (| id:* id: * names:"* id: *" ) )

This seems like a categorical error - I assume that ideally this kind of thing should never be possible and that there should always be a safe abstraction for "prepared queries" where an SQL-injection type issue isn't possible at all.

That being said, I'm assuming that this doesn't actually lead to any security issues (otherwise there would be issues with allowing this REST API at all), but in this case it just leads to a degraded UX.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working or in unexpected wayswebuiWebUI issues

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions