Page MenuHomePhabricator

XSS in WDQS query helper
Closed, ResolvedPublicSecurity

Description

In the query helper panel of WDQS, XSS can occur in the suggestion drop down of the "filter" or "show" inputs if the item or property contain HTML. You can test this by clicking on the filter button and searching for Q43981281, which is a book that has a script tag in its title.

Event Timeline

First patch:

That said, git grep '\$([^)]*+' brings up some other places where we seem to be concatenating HTML into $() calls, so I want to review those too. (I’d previously looked for unsafe .html() calls, see T238822#5681271.)

Deployment will presumably using the same procedure as whatever we decide on in T297686.

That said, git grep '\$([^)]*+' brings up some other places where we seem to be concatenating HTML into $() calls, so I want to review those too. (I’d previously looked for unsafe .html() calls, see T238822#5681271.)

Found one more vulnerability (T298871), the other such calls aren’t great either but don’t seem to be vulnerable as far as I can tell (the relevant strings don’t seem to be user-controlled).

First patch:

That said, git grep '\$([^)]*+' brings up some other places where we seem to be concatenating HTML into $() calls, so I want to review those too. (I’d previously looked for unsafe .html() calls, see T238822#5681271.)

Deployment will presumably using the same procedure as whatever we decide on in T297686.

I can confirm that this patch fixes the issue and it makes sense to me code-wise. I'm giving it my virtual +1 and it is ready to be deployed, as far as I'm concerned.

Patch seems sane, +1 from the Security-Team. Unfortunately, I still do not believe we have a great way to security deploy patches to wdqs (unless something has changed in the last week), so T297686#7584787 might still be the best deployment guidance we can provide at this time.

Addshore changed the visibility from "Custom Policy" to "Public (No Login Required)".
Addshore changed the edit policy from "Custom Policy" to "All Users".