Flag emoji such as π³οΈβπ π³οΈββ§οΈ π΄ββ οΈ containing zero-width joiners are broken up in subject lines
Categories
(Thunderbird :: Message Reader UI, defect)
Tracking
(Not tracked)
People
(Reporter: duxovni, Assigned: darktrojan)
References
(Regression)
Details
(Keywords: regression)
Attachments
(3 files, 1 external file)
Steps to reproduce:
Send myself an email with π³οΈβπ (rainbow flag emoji), π³οΈββ§οΈ (trans flag emoji), and/or π΄ββ οΈ (pirate flag emoji) in the subject line.
Actual results:
The email subject is displayed as π³ π π³ β§ π΄ β in the message list, and in the subject line when opening the message.
Expected results:
The flag emoji should be displayed normally in their combined forms as π³οΈβπ π³οΈββ§οΈ π΄ββ οΈ.
Comment 2•2 years ago
|
||
Also, please attach a sample message as .eml
Comment 6•2 years ago
•
|
||
I see the problem here too.
The bug also shows up in the composer.
STR:
- start a new e-mail.
- copy and past e.g. the rainbow flag π³οΈβπ into the subject and the body.
- save to draft.
In the body of the draft message, the flag is correctly coded with the following 4 code points as:
<u+1F3F3><u+FE0F><u+200D><u+1F308>
www.unicode.org/emoji/charts/full-emoji-list.html#1f3f3_fe0f_200d_1f308
(Please be patient. The page needs some time to load.)
However, the subject only contains 2 code points:
<u+1F3F3> <u+1F308>
Comment 7•2 years ago
|
||
It's a feature, they are removed here:
https://searchfox.org/comm-central/rev/76b0f85a58d580310018ffd06fd87c1963febf7f/mailnews/mime/jsmime/jsmime.mjs#336,359
From bug 1617370:
https://hg.mozilla.org/comm-central/rev/84249ce5084a8b7a0925b5d35c00331870a56a0c#l1.45
https://hg.mozilla.org/comm-central/rev/84249ce5084a8b7a0925b5d35c00331870a56a0c#l1.68
Looks like the intended sanitisation damages those emojis.
Updated•2 years ago
|
Comment 8•2 years ago
|
||
Example with rainbow flag and several ZERO WIDTH JOINERs as well as several VARIATION SELECTORs in the From header
Updated•2 years ago
|
Comment 9•2 years ago
|
||
Neither the ZERO WIDTH JOINER nor the VARIATION SELECTOR 16 are spaces in the true sense of the word. They therefore do not create empty space and are therefore not relevant for Bug 1506587 in my opinion.
I have therefore removed them from cleanToken().
In the picture you can see the correct rainbow flag without an empty space appearing after the βZWF:β or the βVS16:β.
Or is this more of a wontfix?
| Reporter | ||
Comment 10•2 years ago
|
||
Thanks for finding that!
Looking at those bug reports, it sounds like the goal of removing those characters was to prevent a malicious sender breaking up a series of consecutive spaces like <space><zwj><space><variation selector 16><space> to avoid detection. But if that's the goal, then the regex should only remove those characters when they're preceded by actual space characters. Also, if this is about spoofing senders, then this extra-strict sanitisation should only be applied to the From header, not other headers like Subject.
| Reporter | ||
Comment 11•2 years ago
|
||
It seems like the correct sanitisation behavior would be specifically to replace "a space character followed by a run of only spaces and zero-width codepoints" with a single space.
| Assignee | ||
Comment 12•1 year ago
|
||
I think we lose more than we gain by removing these two characters, so I'm going to propose a patch to allow them specifically.
| Assignee | ||
Comment 13•1 year ago
|
||
Updated•1 year ago
|
Updated•1 year ago
|
| Assignee | ||
Updated•1 year ago
|
Comment 14•1 year ago
|
||
Pushed by vineet@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/52bb4edba5c2
Allow U+200D and U+FE0E/U+FE0F characters in header sanitisation to allow emoji sequences. r=mkmelin
Description
•