Page MenuHomePhabricator

Consider deprecating/removing the xslt option from the action api
Closed, ResolvedPublic

Description

The api has an xslt option to append a stylesheet.

I suspect i am the only one who ever used it (i made a script once where if you double clicked a word it would open wiktionary api in an iframe with xslt to show a pretty version of the word https://en.wiktionary.org/w/api.php?action=parse&format=xml&xslt=MediaWiki%3AextractFirst.xsl&prop=text&page=word&lang=en&count=1&showWord=none&audio=none&redirects=on obviously this no longer works due to x-frame-options )

Modern browsers wont load the stylesheet. I think due to x-content-options: nosniff. So the feature really does nothing and is impossible to use.

Additionally browsers are talking about killing xslt in general https://github.com/whatwg/html/issues/11523

All signs suggest we should just kill this feature

Related Objects

StatusSubtypeAssignedTask
OpenNone
OpenNone
ResolvedAtieno

Event Timeline

Acknowledging request and adding it to our backlog for prioritization

Acknowledging request and adding it to our backlog for prioritization

See also: T401995

Acknowledging request and adding it to our backlog for prioritization

Hey @Atieno - any update on this? Thanks.

Hi @sbassett We have it in our backlog but we've never really looked into it. Will align this with the team on if we can prioritize

Atieno triaged this task as High priority.

Change #1203865 had a related patch set uploaded (by Atieno; author: Atieno):

[mediawiki/core@master] ActionApi: Remove the xslt option

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

According to turnilo we are getting a couple of hundred requests per day with the xslt= parameter set. All for action=parse, from various IPs with UA strings that look like browsers. That suggests a Gadget.

EDIT: it uses https://en.wiktionary.org/wiki/MediaWiki:ExtractFirst.xsl which exists on several .wikis

According to turnilo we are getting a couple of hundred requests per day with the xslt= parameter set. All for action=parse, from various IPs with UA strings that look like browsers. That suggests a Gadget.

EDIT: it uses https://en.wiktionary.org/wiki/MediaWiki:ExtractFirst.xsl which exists on several .wikis

That's my gadget - https://en.wikinews.org/wiki/Wikinews:JavaScript#Wiktionary_lookup_gadget_.28Hover_box_variety.29

However, it looks like this is already broken due to the recently added CSP policy to the API which blocks XSLT, even when directly viewed. The gadget loads the page in an iframe, so has been broken by X-Frame-options header probably for like a decade at this point.

And of course it will all break when https://developer.chrome.com/docs/web-platform/deprecating-xslt goes through.

If this is the only gadget using it, I have minimal concerns about removing it. I suggest that we announce the change is coming and give it a soak period of a week or two before actually removing it, though. Based on the description (and the fact that the gadget calling it has seemingly been broken for a while, haha), it doesn't seem like it is terribly urgent.

I'm also chiming in on the other ticket (https://phabricator.wikimedia.org/T401995) about having comms about it, even if we don't have a full/official deprecation cycle for it.

According to turnilo we are getting a couple of hundred requests per day with the xslt= parameter set. All for action=parse, from various IPs with UA strings that look like browsers. That suggests a Gadget.

reedy@deploy2002:/srv/mediawiki-staging$ mwgrep "xslt="
enwikinews          MediaWiki:Gadget-dictionaryLookupHover.js
eswiktionary        MediaWiki:Gadget-dictionaryLookupHover.js
fawiki              MediaWiki:Gadget-dictionaryLookupHover.js
frwiki              MediaWiki:Gadget-dictionaryLookupHover.js
pswiki              MediaWiki:Gadget-dictionaryLookupHover.js
shnwikinews         MediaWiki:Gadget-dictionaryLookupHover.js
shnwiktionary       MediaWiki:Lookup.js
srwikinews          MediaWiki:Gadget-dictionaryLookupHover.js
tawiki              MediaWiki:Gadget-Wiktionarylookup.js
tawikisource        MediaWiki:Gadget-dictLookup.js
vecwiki             MediaWiki:Gadget-dictionaryLookupHover.js

(total: {'value': 11, 'relation': 'eq'}, shown: 11)

Change #1207846 had a related patch set uploaded (by Atieno; author: SomeRandomDeveloper):

[mediawiki/core@REL1_44] SECURITY: Disable xslt option by default

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

Change #1207847 had a related patch set uploaded (by Atieno; author: SomeRandomDeveloper):

[mediawiki/core@REL1_43] SECURITY: Disable xslt option by default

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

Change #1208021 had a related patch set uploaded (by SBassett; author: Atieno):

[mediawiki/core@wmf/1.46.0-wmf.3] ActionApi: Remove the xslt option

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

Change #1208021 merged by jenkins-bot:

[mediawiki/core@wmf/1.46.0-wmf.3] ActionApi: Remove the xslt option

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

Mentioned in SAL (#wikimedia-operations) [2025-11-20T22:43:28Z] <sbassett@deploy2002> Started scap sync-world: Backport for [[gerrit:1208021|ActionApi: Remove the xslt option (T401987 T401995)]]

Change #1203865 merged by jenkins-bot:

[mediawiki/core@master] ActionApi: Remove the xslt option

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

Mentioned in SAL (#wikimedia-operations) [2025-11-20T23:19:38Z] <sbassett@deploy2002> sbassett: Backport for [[gerrit:1208021|ActionApi: Remove the xslt option (T401987 T401995)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Change #1208036 had a related patch set uploaded (by SBassett; author: Atieno):

[mediawiki/core@REL1_45] ActionApi: Remove the xslt option

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

Mentioned in SAL (#wikimedia-operations) [2025-11-20T23:32:46Z] <sbassett@deploy2002> Finished scap sync-world: Backport for [[gerrit:1208021|ActionApi: Remove the xslt option (T401987 T401995)]] (duration: 49m 18s)

Update

  1. The hard deprecation xslt patch is now merged on master, 1.46.0-wmf.3 (and deployed to Wikimedia production). There's also a currently-conflicted version of the patch up for review for REL1_45.
  2. The softer xslt deprecation patch is also now up for review for REL1_44 and REL1_43.

Change #1208038 had a related patch set uploaded (by SomeRandomDeveloper; author: SomeRandomDeveloper):

[mediawiki/core@REL1_43] SECURITY: Disable xslt option by default

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

Change #1208038 had a related patch set uploaded (by SomeRandomDeveloper; author: SomeRandomDeveloper):

[mediawiki/core@REL1_43] SECURITY: Disable xslt option by default

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

I've used the cherry pick button in gerrit to properly cherry pick this so it's properly linked to the REL1_44 patch (and because it was easier than updating the other gerrit changeset, which contained an old version of the patch)

Change #1207847 abandoned by Atieno:

[mediawiki/core@REL1_43] SECURITY: Disable xslt option by default

Reason:

Abandoned for https://gerrit.wikimedia.org/r/c/mediawiki/core/+/1208038

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

Change #1208038 merged by jenkins-bot:

[mediawiki/core@REL1_43] SECURITY: Disable xslt option by default

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

Change #1208364 had a related patch set uploaded (by Reedy; author: SomeRandomDeveloper):

[mediawiki/core@REL1_39] SECURITY: Disable xslt option by default

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

Change #1208036 abandoned by SBassett:

[mediawiki/core@REL1_45] ActionApi: Remove the xslt option

Reason:

In favor of using Icbc3fa9e4

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

Change #1208368 had a related patch set uploaded (by SBassett; author: SomeRandomDeveloper):

[mediawiki/core@REL1_45] SECURITY: Disable xslt option by default

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

Hello all this is ready for merge REL1_44

Change #1207846 merged by jenkins-bot:

[mediawiki/core@REL1_44] SECURITY: Disable xslt option by default

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

Change #1208368 merged by jenkins-bot:

[mediawiki/core@REL1_45] SECURITY: Disable xslt option by default

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

Change #1208364 merged by jenkins-bot:

[mediawiki/core@REL1_39] SECURITY: Disable xslt option by default

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

Just scanning over https://gerrit.wikimedia.org/r/q/T401987, it looks like all of the backports have landed? And the hard deprecation is on master and in Wikimedia production, ready for 1.46 when it gets cut. So I think we can at least tentatively resolve this for now.

Reedy added a subtask: Restricted Task.Mon, Dec 8, 6:09 PM
Reedy added a parent task: Restricted Task.
Reedy closed subtask Restricted Task as Resolved.Mon, Dec 8, 7:23 PM