Page MenuHomePhabricator

WikiHiero/Hierator security review
Closed, InvalidPublic

Description

I'm preparing a major facelift to WikiHiero, to make it use images of rendered via the Hierator service, as opposed to the current PNGs of separate hieroglyphs combined through HTML tables. I would appreciate a security review for it before it goes into betalabs/prod.

WikiHiero: change up for review https://gerrit.wikimedia.org/r/#/c/178269/

  • Uses Hierator for generation of SVG images and their PNG fallbacks that are later stored by RESTBase.
  • Can be merged before Hierator is deployed because it would still use PHP rendering by default.
  • Fallbacks necessitate the use of inline CSS, unfortunately.

Hierator: hieroglyphic text rendering service, implemented as a Java servlet. Uses JSesh for actual rendering.

Event Timeline

MaxSem raised the priority of this task from to Needs Triage.
MaxSem updated the task description. (Show Details)
MaxSem added subscribers: MaxSem, csteipp.

For https://github.com/wikimedia/mediawiki-services-hierator

  • I would prefer if HieratorServlet::processRequest() escaped the exception message before outputting it. Since all of the exceptions are currently plain text strings, this isn't exploitable, but if the code is updated to output something attacker controlled in the exception message, xss would be possible.
  • The service should add all of the security headers that restbase sets (could actually be more strict in many cases). I think the following should cover legitimate uses of the service:
    • X-Content-Type-Options = nosniff
    • X-Frame-Options: DENY (unless you really need these iframed.. but it looks like they're all included via img tags)
    • X-XSS-Protection: 1; mode=block
    • Content-Security-Policy/X-Content-Security-Policy/X-WebKit-CSP = default-src 'none'; img-src 'self'; style-src 'unsafe-inline' 'self'; frame-ancestors 'self'
Restricted Application edited subscribers, added: StudiesWorld; removed: Liuxinyu970226. · View Herald TranscriptNov 13 2015, 8:47 PM