Page MenuHomePhabricator

BotPasswords doesn't validate length of resultant bp_restrictions JSON
Closed, ResolvedPublicSecurity

Description

Forking from T260578

If you add many many IPs to an MWRestrictions object, such as via a BotPassword, it's possible to end up with a JSON string longer than BLOB will allow. This will result in truncated JSON being saved into the database, and as such, when it's retrieved, won't validate as JSON

Validation needs adding to check the length of bp_restrictions to be inserted is <= 65535 characters

And if it's longer... Some error should be thrown to the user, and the row not inserted

Technically blocks T108255: Enable MariaDB/MySQL's Strict Mode

Event Timeline

Reedy renamed this task from BotPasswords doesn't validate length of resultant JSON to BotPasswords doesn't validate length of resultant bp_restrictions JSON.Aug 17 2020, 11:38 PM

Change 631954 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@master] Validate max length of bp_restrictions and bp_grants

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

Change 645357 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@REL1_31] Validate max length of bp_restrictions and bp_grants

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

Change 645358 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/core@REL1_35] Validate max length of bp_restrictions and bp_grants

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

Change 631954 merged by jenkins-bot:
[mediawiki/core@master] Validate max length of bp_restrictions and bp_grants

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

Change 645358 merged by jenkins-bot:
[mediawiki/core@REL1_35] Validate max length of bp_restrictions and bp_grants

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

Change 645357 merged by jenkins-bot:
[mediawiki/core@REL1_31] Validate max length of bp_restrictions and bp_grants

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

Reedy claimed this task.
Reedy removed a project: Patch-For-Review.
Reedy changed the visibility from "Custom Policy" to "Public (No Login Required)".
Reedy changed the edit policy from "Custom Policy" to "All Users".