Page MenuHomePhabricator

Extension:CSS does not sanitize CSS from article pages
Closed, ResolvedPublic

Description

Author: GICodeWarrior

Description:
The extension should add a custom URL parameter to the link and hook into RawPageViewBeforeOutput to sanitize CSS requests with that parameter.

Inline CSS is already sanitized, and "external" files can't/shouldn't be sanitized. However, the same custom URL parameter must be appended to "external" includes so if they are actually referencing wiki pages, they will be sanitized appropriately.

"external" URLs should also be expanded and verified to be inside the base (to prevent "../../").


Version: unspecified
Severity: normal

Details

Reference
bz32154
TitleReferenceAuthorSource BranchDest Branch
Publish docs on doc.wikimedia.orgrepos/mwbot-rs/toolforge!12legoktmdocsmain
Don't clobber docpub's after_scriptrepos/mwbot-rs/rust-ci-pipeline!9legoktmfix-docsmain
Publish docs to doc.wikimedia.orgrepos/mwbot-rs/mwbot!48legoktmdocsmain
Publish docs to doc.wikimedia.orgrepos/mwbot-rs/rust-ci-pipeline!7legoktmdocsmain
Add mwbot-rs repositories to allowed_projectsrepos/releng/docpub!2legoktmlegoktm-main-patch-37581main
Customize query in GitLab

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 12:08 AM
bzimport set Reference to bz32154.

GICodeWarrior wrote:

I also need to turn the inline styles into a link tag to eliminate any injection possibility there.

GICodeWarrior wrote:

Should be taken care of in r103771.

I don0t think goign through javascript would be needed.

GICodeWarrior wrote:

(In reply to comment #3)

I don0t think goign through javascript would be needed.

Care to elaborate?

We have code for CSS sanitizing in other parts of MediaWiki, the CSSMin class is able to remap and datify css urls... I'm not an expert with that part, but I think the needed pieces should be there.