Page MenuHomePhabricator

CheckUser: Storing private data fails when system OpenSSL doesn't support RC4
Closed, ResolvedPublic

Description

Summary

CheckUser uses an outdated algorithm for storing encrypted data and has insufficient error handling to diagnose related errors.

Background

CheckUser stores some private data encrypted, namely the recipients of emails sent via EmailUser if $wgCUPublicKey is valid.
This uses the RC4 algorithm for encryption, which is disabled on some systems (e.g. on Fedora and derivatives since 2015[1]) due to security concerns.

The code however does not handle encryption-related errors, so a failure due to a missing algorithm would only result in a cryptic PHP Notice (Trying to access array offset on null).


[1] https://fedoraproject.org/wiki/Changes/RemoveSSL3andRc4

Technical notes

The code should raise a meaningful error if encryption fails and it should preferably use a more secure algorithm.

Acceptance criteria

  • CheckUser can store private data even if system OpenSSL doesn't have RC4 enabled
  • CheckUser reports meaningful errors if it cannot store encrypted data

Event Timeline

Change #1113234 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/CheckUser@master] [PoC] Encrypt private data using sodium APIs

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

Change #1114353 had a related patch set uploaded (by Máté Szabó; author: Máté Szabó):

[mediawiki/extensions/CheckUser@master] phpunit: Skip testOnEmailWithCUPublicKeyDefined without RC4

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

Change #1114353 merged by jenkins-bot:

[mediawiki/extensions/CheckUser@master] phpunit: Skip testOnEmailWithCUPublicKeyDefined without RC4

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

Change #1113234 abandoned by Dreamy Jazz:

[mediawiki/extensions/CheckUser@master] [PoC] Encrypt private data using sodium APIs

Reason:

We have decided to drop cuc_private, so this patch is no longer needed

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