Page MenuHomePhabricator

User script on user subpage doesn't work after user rename
Open, Needs TriagePublic

Assigned To
None
Authored By
1997kB
Jan 18 2021, 1:05 PM
Referenced Files
F34006552: image.png
Jan 18 2021, 1:51 PM
Tokens
"Like" token, awarded by Pppery."The World Burns" token, awarded by Wellverywell."The World Burns" token, awarded by MBH."The World Burns" token, awarded by Jack_who_built_the_house.

Description

When a user is renamed, their user scripts too, but on the old title a redirect is set to the new (Eg: Old title and New title). And recently a user found that the script doesn't work for anyone who had installed the script before rename.

As a lot of users get renamed every day, it is not possible to fix these plus they require an interface admin.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
1997kB updated the task description. (Show Details)

Can't reproduce, the redirect works fine with my Firefox 78.6.1 ESR on Debian buster. Which browser are you using?

I am using Chrome Version 87.0.4280.141. Tried firefox 84.0.2 and I can reproduce it.

image.png (141×869 px, 11 KB)

Ah, that explains it (and why I couldn't reproduce by just copying and pasting the code to my browsers console). Tagging security for awareness.

Aklapper renamed this task from User scipt doesn't work after rename to User script on user subpage doesn't work after user rename.Jan 18 2021, 4:24 PM

Currently old username is added to antispoof so only an account creator or admin can register them, but if that's not enough, I support it blocking forever (only when js pages are involved and there's a redirect) instead of breaking all these scripts.

Security tasks {T256558} and {T183212} may be relevant

Yahya removed the point value for this task.Dec 26 2022, 7:43 AM
Yahya added subscribers: MdsShakil, Titore, Zabe and 5 others.

We could probably allow loading orphaned javascript pages as long as they are redirects, those are already protected against editing.

So, if a Toolforge account maintaining a script is adopted, the script is moved, BAM – all script users no longer can load it, until an interface-admin runs a bot task to replace the user name in the scripts loading it. (This is what just happened in ruwiki.)

Change 986666 had a related patch set uploaded (by SD0001; author: SD0001):

[mediawiki/core@master] Allow loading JS/CSS pages orphaned due to user renames

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

We could probably allow loading orphaned javascript pages as long as they are redirects, those are already protected against editing.

Sounds like a good idea. Filed a patch to do this. ^

stjn subscribed.

This continuously causes issues with user scripts after any rename, I am asking someone from Security-Team to take time to review the patch provided.

sbassett edited projects, added SecTeam-Processed; removed GlobalRename.
sbassett added subscribers: mmartorana, sbassett.

This continuously causes issues with user scripts after any rename, I am asking someone from Security-Team to take time to review the patch provided.

@mmartorana will have a look. As long as there aren't any issues with username usurpation, etc, the patch is probably fine.