Page MenuHomePhabricator

wbmergeitems doesn't need a token to merge items
Closed, ResolvedPublic

Description

When you click on the example links in the api you would automatically merge the Items in Wikidata. You don't need a edit token or anything. We probably don't want that.

Event Timeline

Maniphest changed the visibility from "Public (No Login Required)" to "Custom Policy".Mar 20 2015, 3:00 PM
Maniphest changed the edit policy from "All Users" to "Custom Policy".
Lucie updated the task description. (Show Details)
Lucie added projects: Wikidata, acl*security.
Lucie changed Security from None to Software security bug.
Lucie edited subscribers, added: Lucie, aude, daniel; removed: Aklapper.

Fix:

Add the following to MergeItems.php

	public function needsToken() {
		return true;
	}

The module should also require a POST request

The module should also require a POST request

Oh, indeed, yes.

I guess we also need a patch for the Wikidata repository for deployment?

I guess we also need a patch for the Wikidata repository for deployment?

Yes... we'll take care of everything.

tried the patch locally, doing a get request with token parameter and get "The 'token' parameter was found in the query string, but must be in the POST body"

thus, I think the patch is good and sufficient.

thanks legoktm!

Applies cleanly to both 1.25wmf19 and 1.25wmf22 of Wikidata (the deployed branches).

Patch applied, verified and deployed. I will close/ publish this bug once we fix this on master.

hoo changed Security from Software security bug to None.Mar 23 2015, 2:37 PM
hoo changed the visibility from "Custom Policy" to "Public (No Login Required)".Mar 23 2015, 3:34 PM
hoo changed the edit policy from "Custom Policy" to "All Users".

Change 198736 had a related patch set uploaded (by Hoo man):
Make the merge item API require an edit token

https://gerrit.wikimedia.org/r/198736

@Magnus: I think your tools are fine but just in case you run into trouble...
@Ladsgroup, @Multichill, @Sjoerddebruin: for your info as well in case you see any bot user having issues

hoo claimed this task.

Change 198736 merged by jenkins-bot:
Make the merge item API require an edit token

https://gerrit.wikimedia.org/r/198736

As far as I could tell, the merge gadget and Magnus' tools all do the right thing and use post + token, which means they shouldn't be affected by this change.

I checked my scripts and all of them use token

Change 198747 had a related patch set uploaded (by Hoo man):
Make the merge item API require an edit token

https://gerrit.wikimedia.org/r/198747

Change 198747 merged by jenkins-bot:
Make the merge item API require an edit token

https://gerrit.wikimedia.org/r/198747