Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Page MenuHomePhabricator

User script on user subpage doesn't work after user rename
Open, In Progress, MediumPublic

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.

{F34006552}

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.

mmartorana changed the task status from Open to In Progress.Apr 23 2024, 2:30 PM
mmartorana triaged this task as Medium priority.

Hey @stjn - I voted +1 on the gerrit change, as the proposed change appears to be secure in my opinion.

This came up today at https://en.wikipedia.org/wiki/User_talk:Anne_drew/SetupAutoArchive#Page_move. It's a bit unintuitive for redirects generated by an official MediaWiki extension to not work. Hopefully the patch in this ticket can continue moving forward.

@mmartorana it looks like someone needs to re-vote on code review now that CI is passing