Page MenuHomePhabricator

CVE-2022-41767: reassignEdits doesn't update results in an IP range check on Special:Contributions
Closed, ResolvedPublicSecurity

Description

I reassigned the edits on https://www.wikidata.org/wiki/Special:Contributions/2001:B07:6462:512A:8:6B2F:A067:426A/64 but that page still shows those commits, but attributed to the user they were reassigned to.

After reassigning, it shouldn't show any results.

Event Timeline

Reedy renamed this task from reassignEdits doesn't seem to update a range check on Special:Contributions to reassignEdits doesn't seem to update results in an IP range check on Special:Contributions.Aug 26 2022, 12:13 AM
Reedy changed Author Affiliation from N/A to WMF Technology Dept.
Reedy updated the task description. (Show Details)

If the "from user" is an IP, it would look like we just want to delete the rows in ip_changes for the hex(ipaddress) is probably enough to fix this edge case...

If the "to user" is an IP, we probably want to be inserting rows... We can't move a users edits to an IP.

Ignoring the report only modes etc... Something like this should be sufficient.

		if ( !$from->isRegistered() ) {
			$dbw->delete(
				'ip_changes',
				[
					'ipc_hex' => IPUtils::toHex( $from->getName() )
				]
			);
		}

Reedy triaged this task as Low priority.Aug 26 2022, 1:28 AM

+2

I'm proposing we just ship this through Gerrit, unless anyone objects

I'm proposing we just ship this through Gerrit, unless anyone objects

Is the only risk here that the reassigned edits potentially link a username to one of their actual IPs, if someone's clever enough to understand what happened during the edit reassign process? I feel like a discreet gerrit change set with a benign commit msg that doesn't call that issue out (or any other potential privacy risk) is probably low risk, especially if this bug stays private until it goes out with the next train.

I'm proposing we just ship this through Gerrit, unless anyone objects

Is the only risk here that the reassigned edits potentially link a username to one of their actual IPs, if someone's clever enough to understand what happened during the edit reassign process? I feel like a discreet gerrit change set with a benign commit msg that doesn't call that issue out (or any other potential privacy risk) is probably low risk, especially if this bug stays private until it goes out with the next train.

Yeah. The script is very seldom run in Wikimedia projects anyway... But I would propose to clean up those 3 ip_changes rows manually (which can be done at any time) first

sbassett added a project: SecTeam-Processed.
sbassett changed Risk Rating from N/A to Low.

I've cleaned up the affected rows from the task description.

Reedy renamed this task from reassignEdits doesn't seem to update results in an IP range check on Special:Contributions to reassignEdits doesn't update results in an IP range check on Special:Contributions.Sep 28 2022, 2:30 PM
Reedy renamed this task from reassignEdits doesn't update results in an IP range check on Special:Contributions to CVE-2022-41767: reassignEdits doesn't update results in an IP range check on Special:Contributions.Sep 29 2022, 5:29 PM

Change 836891 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_35] SECURITY: reassignEdits: Delete rows from ip_changes

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

Change 836895 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_37] SECURITY: reassignEdits: Delete rows from ip_changes

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

Change 836899 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_38] SECURITY: reassignEdits: Delete rows from ip_changes

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

Change 836904 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@REL1_39] SECURITY: reassignEdits: Delete rows from ip_changes

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

Change 836909 had a related patch set uploaded (by Reedy; author: Reedy):

[mediawiki/core@master] SECURITY: reassignEdits: Delete rows from ip_changes

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

Change 836891 merged by jenkins-bot:

[mediawiki/core@REL1_35] SECURITY: reassignEdits: Delete rows from ip_changes

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

Change 836895 merged by jenkins-bot:

[mediawiki/core@REL1_37] SECURITY: reassignEdits: Delete rows from ip_changes

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

Change 836904 merged by jenkins-bot:

[mediawiki/core@REL1_39] SECURITY: reassignEdits: Delete rows from ip_changes

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

Change 836909 merged by jenkins-bot:

[mediawiki/core@master] SECURITY: reassignEdits: Delete rows from ip_changes

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

Change 836899 merged by Reedy:

[mediawiki/core@REL1_38] SECURITY: reassignEdits: Delete rows from ip_changes

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

Reedy changed the visibility from "Custom Policy" to "Public (No Login Required)".Nov 1 2022, 6:07 PM
Reedy changed the edit policy from "Custom Policy" to "All Users".