Last modified: 2014-01-14 07:28:30 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T59025, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 57025 - Add CSRF checks to Special:CreateCategory
Add CSRF checks to Special:CreateCategory
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
SemanticForms (Other open bugs)
unspecified
All All
: Unprioritized normal (vote)
: ---
Assigned To: Yaron Koren
https://bugzilla.mozilla.org/show_bug...
:
Depends on:
Blocks: 59830
  Show dependency treegraph
 
Reported: 2013-11-13 19:15 UTC by Chris Steipp
Modified: 2014-01-14 07:28 UTC (History)
8 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Add and check csrf token in form (1.77 KB, patch)
2013-11-13 19:15 UTC, Chris Steipp
Details

Description Chris Steipp 2013-11-13 19:15:12 UTC
Created attachment 13789 [details]
Add and check csrf token in form

Special:CreateCategory doesn't add and validate an anti-csrf token in the form. Logged in users can be tricked into creating categories by visiting a site that makes a request on behalf of the user.

Basic patch attached, but I don't have a system to test this available. Can someone check this?
Comment 1 Chris Steipp 2013-11-13 19:16:41 UTC
Reported by Ravindra Singh Rathore to Mozilla.
Comment 2 Yaron Koren 2013-11-13 20:22:34 UTC
Hi Chris,

Thanks for this patch! A few questions and comments:

- It looks like the method User::getEditToken() was only added in MediaWiki 1.19 - Semantic Forms currently supports MW 1.17 and higher, so there would need to be an "if" statement to only apply this handling if for MW 1.19 and higher.

- Would there be a benefit to displaying an error message if the token validation fails, instead of just ignoring the attempt as the current patch seems to do?

- Semantic Forms defines four other special pages with similar forms: CreateProperty, CreateTemplate, CreateForm and CreateClass. I assume they could all similarly benefit from an anti-CSRF check?
Comment 3 Chris Steipp 2013-11-13 20:28:23 UTC
Yaron,

Yeah, feel free to update the patch. That was just something quick to address the issue. I wasn't sure how actively the extension is maintained.

If you can get a patch today, I'll add a note about it in the upcomming security release. Typically, just add a patch here, and we'll push it into gerrit when we make the announcement.

Or, if you need more time, we'll add it to the next one.
Comment 4 Chris Steipp 2013-11-13 20:28:53 UTC
(In reply to comment #2)
> - Semantic Forms defines four other special pages with similar forms:
> CreateProperty, CreateTemplate, CreateForm and CreateClass. I assume they
> could
> all similarly benefit from an anti-CSRF check?

And yes, definitely, to this.
Comment 5 Yaron Koren 2013-12-27 01:20:41 UTC
Okay, this security vulnerability has now been fixed for those five special pages, for MW 1.19 and higher. Thanks for the patch!

I have to say that I was surprised by the comment about announcing this in a security release - I wasn't aware that the WMF ever made announcements about non-WMF extensions, security-related or otherwise.
Comment 6 Chad H. 2013-12-27 01:24:42 UTC
(In reply to comment #5)
> I have to say that I was surprised by the comment about announcing this in a
> security release - I wasn't aware that the WMF ever made announcements about
> non-WMF extensions, security-related or otherwise.

We don't. This is weird to me too :)
Comment 7 Chris Steipp 2013-12-30 17:43:05 UTC
Thanks Yaron, can you add links to the gerrit patches that fixed this?

(In reply to comment #6)
> (In reply to comment #5)
> > I have to say that I was surprised by the comment about announcing this in a
> > security release - I wasn't aware that the WMF ever made announcements about
> > non-WMF extensions, security-related or otherwise.
> 
> We don't. This is weird to me too :)

We're using SemanticForms on Wikitech, so I assumed we treated it like a WMF-deployed extension. It's also widely enough deployed that I'll probably mention it when we do the release.

Adding Ryan/Coren so they can get wikitech patched.
Comment 8 Chris Steipp 2013-12-30 17:47:57 UTC
https://gerrit.wikimedia.org/r/#/c/103885/ was the fix
Comment 9 Yaron Koren 2013-12-30 18:19:08 UTC
Yes, you found it. Well, it's nice to hear that SF is considered (by some) to be a WMF extension!

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links