Page MenuHomePhabricator

T426631 EasyTimeline hardening corrupts UTF-8 multibyte characters containing 0x85 in text attributes
Closed, ResolvedPublicBUG REPORT

Description

Summary:
T426631: CVE-2026-8857: Full RCE using EasyTimeline Extension introduced hardening in the EasyTimeline extension to detect and remove vertical whitespace characters from text attributes of BarData or TextData. However, the current implementation removes the byte 0x85 indiscriminately, even when it appears as part of a valid UTF-8 multibyte sequence. The hardening appears to use Perl Regular Expression Character Class \v for detection and removal. In Perl, \v matches the NEXT LINE character (U+0085). If the sanitization is performed on raw bytes rather than decoded Unicode characters, it can incorrectly remove the 0x85 byte from valid UTF-8 multibyte sequences.

Steps to replicate the issue (include links if applicable):

  • Create a timeline with method="svg2png" (just for verbose error output).
  • Add a BarData or TextData whose text attribute contains a character such as "々" (U+3005: E3 80 85) or "居" (U+5C45: E5 B1 85), whose UTF-8 encoding includes the byte 0x85.
  • Save the page or preview it.

What happens?:

<timeline method="svg2png">
ImageSize = width:500 height:500
PlotArea  = left:50 right:50 bottom:50 top:50
AlignBars = justify
DateFormat = yyyy
Period = from:2000 till:2010
TimeAxis = orientation:vertical
ScaleMajor = unit:year increment:5 start:2000
TextData = 
  pos:(10,10) text:"々"
BarData = 
  bar:Leaders text:"々"
PlotData = 
  bar:Leaders from:start till:end text:"々"
</timeline>
Unable to convert SVG to PNG:

EasyTimeline version 1.90
Copyright (C) 2004 Erik Zachte
Email xxx@chello.nl (nospam: xxx=epzachte)

This program is free software; you can redistribute it
and/or modify it under the terms of the 
GNU General Public License version 2 as published by
the Free Software Foundation
------------------------------------------------------

OS Linux detected -> create image in png format.

Input:  Script file file
Output: Image files file.png & file.svg
        Map file file.map (add to html for clickable map)
Ploticus input file = /tmp/EasyTimeline.txt.354902

Generating output:
Using ploticus command "/usr/bin/ploticus" (/usr/bin/ploticus)
Running Ploticus to generate svg file file.svg
'/usr/bin/ploticus' -noshell  -svg -o 'file.svg' '/tmp/EasyTimeline.txt.354902' -tightcrop -font ''FreeSans'' -xml_encoding UTF-8
Running Ploticus to generate bitmap file file.png
'/usr/bin/ploticus' -noshell  -png -o 'file.png' '/tmp/EasyTimeline.txt.354902' -tightcrop -font 'FreeSans'

WARNING(S)
Line 9:   pos:(10,10) text:"々"
- TextData attribute 'text' contains ~ (tilde).
  Tilde will not be translated into newline character (only in PlotData)

Line 11:   bar:Leaders text:"々"
- BarData attribute 'text' contains ~ (tilde).
  Tilde will not be translated into newline character (only in PlotData)



READY
No errors found.
PHP Warning:  Failed to set memory limit to 0 bytes (Current memory usage is 2097152 bytes) in Unknown on line 0
Error reading SVG file.svg: XML parse error: Error domain 1 code 9 on line 29 column 41 of data: Input is not proper UTF-8, indicate encoding !
Bytes: 0xE3 0x80 0x7E 0x3C

What should have happened instead?:
The text attributes should remain unchanged, and the UTF-8 characters should be rendered correctly.

Other information:
This issue was originally reported on ja:Wikipedia:バグの報告#timeline_における_Unable_to_convert_SVG_to_PNG_(XML_parse_error)エラー.

Event Timeline

Aklapper renamed this task from Regression: T426631 EasyTimeline hardening corrupts UTF-8 multibyte characters containing 0x85 in text attributes to T426631 EasyTimeline hardening corrupts UTF-8 multibyte characters containing 0x85 in text attributes.Jul 13 2026, 6:17 PM
Aklapper added a project: Regression.
Aklapper updated the task description. (Show Details)

Change #1343328 had a related patch set uploaded (by Srapoj; author: Srapoj):

[mediawiki/extensions/timeline@master] Fix UTF-8 corruption in newline sanitization

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

Change #1343328 merged by jenkins-bot:

[mediawiki/extensions/timeline@master] Fix UTF-8 corruption in newline sanitization

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

Change #1347692 had a related patch set uploaded (by Srapoj; author: Srapoj):

[mediawiki/extensions/timeline@wmf/1.47.0-wmf.22] Fix UTF-8 corruption in newline sanitization

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

Change #1347692 merged by jenkins-bot:

[mediawiki/extensions/timeline@wmf/1.47.0-wmf.22] Fix UTF-8 corruption in newline sanitization

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

Mentioned in SAL (#wikimedia-operations) [2026-10-01T20:55:38Z] <brennen@deploy1003> Started scap sync-world: Backport for [[gerrit:1347692|Fix UTF-8 corruption in newline sanitization (T431960 T426631)]]

Mentioned in SAL (#wikimedia-operations) [2026-10-01T20:59:35Z] <brennen@deploy1003> brennen, srapoj: Backport for [[gerrit:1347692|Fix UTF-8 corruption in newline sanitization (T431960 T426631)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-10-01T21:06:22Z] <brennen@deploy1003> Finished scap sync-world: Backport for [[gerrit:1347692|Fix UTF-8 corruption in newline sanitization (T431960 T426631)]] (duration: 10m 43s)

Change #1347800 had a related patch set uploaded (by Srapoj; author: Srapoj):

[mediawiki/extensions/timeline@REL1_43] Fix UTF-8 corruption in newline sanitization

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

Change #1347801 had a related patch set uploaded (by Srapoj; author: Srapoj):

[mediawiki/extensions/timeline@REL1_45] Fix UTF-8 corruption in newline sanitization

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

Change #1347802 had a related patch set uploaded (by Srapoj; author: Srapoj):

[mediawiki/extensions/timeline@REL1_46] Fix UTF-8 corruption in newline sanitization

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

Change #1347802 merged by jenkins-bot:

[mediawiki/extensions/timeline@REL1_46] Fix UTF-8 corruption in newline sanitization

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

Change #1347800 merged by jenkins-bot:

[mediawiki/extensions/timeline@REL1_43] Fix UTF-8 corruption in newline sanitization

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

Change #1347801 merged by jenkins-bot:

[mediawiki/extensions/timeline@REL1_45] Fix UTF-8 corruption in newline sanitization

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