View Issue Details

IDProjectCategoryView StatusLast Update
0005351SOGoWeb Mailpublic2022-03-29 14:43
Reporteratsawin Assigned Tofrancis  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
PlatformLinuxOSUbuntuOS Version20.04
Product Versionnightly master 
Fixed in Version5.6.0 
Summary0005351: JSON encode break with particular text in mail subject
Description

When mail subject contain double quote follow by some Thai vowel, result JSON won't escape double quote.

For example, following subjects are encode correctly:

This is a "TEST" --> encoded as "This is a \"TEST\""

Test in "ภาษาไทย" --> encoded as "Test in \"ภาษาไทย\""

However if the double quote character is followed by upper/lower Thai vowel, encode will broken. It won't escape double quote. For example:

Broken "ีกุ้งปิ้ง" bar --> encoded as "Broken "ีกุ้งปิ้ง\" bar" Note that there is character U+0E35 after first double quote. This cause sogo won't escape double quote in JSON.

This error will cause main page goes blank because JavaScript error while parsing JSON.

Steps To Reproduce
  1. Send email (from local or remote) with subject contain follow 2 characters "์
    • The first character is double quote (U+0022 QUOTATION MARK)
    • The second character is U+0E4C (THAI CHARACTER THANTHAKHAT)
  2. Wait for mail delivery. Then login to SOGO webmail with recipient account.
  3. After success login, the page will be blank.
Additional Information
  1. The API that error is:
    https://mail.test.com/SOGo/so/email@test.com/Mail/0/folderINBOX/view

Example JSON is in attached file.

  1. This combination is not valid Thai language. It's from typo.

  2. Sogo version: 5.1.1.20210629-1

  3. Sogo is installed as part of iRedMail.

Tagsjson, webmail

Activities

atsawin

atsawin

2021-07-05 14:59

reporter  

sogo-correct.json (712 bytes)   
{"headers": [["To", "hasAttachment", "isFlagged", "Subject", "From", "isRead", "Priority", "RelativeDate", "Size", "Flags", "uid", "isAnswered", "isForwarded"], [[{"name": "it", "email": "it1@test.com"}, {"email": "it2@test.com"}, {"email": "it3@test.com"}], 0, 0, "test31", [{"name": "John Doe", "email": "joke.a@ppteam.net"}], 0, {"name": "Normal", "level": 3}, "13-Aug-20", "7.6 KiB", [], 2, 0, 0], [[{"name": "it3", "email": "it3@test.com"}], 0, 0, "ทดสอบ \"ีกุ้งปิ้ง\" กิ้งปุ้ง", [{"name": "it2", "email": "it2@test.com"}], 0, {"name": "Normal", "level": 3}, "21:42", "2.8 KiB", [], 3, 0, 0]], "threaded": 0, "syncToken": "4-5", "unseenCount": 2, "uids": [3, 2]}
sogo-correct.json (712 bytes)   
sogo-wrong.json (711 bytes)   
{"headers": [["To", "hasAttachment", "isFlagged", "Subject", "From", "isRead", "Priority", "RelativeDate", "Size", "Flags", "uid", "isAnswered", "isForwarded"], [[{"name": "it", "email": "it1@test.com"}, {"email": "it2@test.com"}, {"email": "it3@test.com"}], 0, 0, "test31", [{"name": "John Doe", "email": "joke.a@ppteam.net"}], 0, {"name": "Normal", "level": 3}, "13-Aug-20", "7.6 KiB", [], 2, 0, 0], [[{"name": "it3", "email": "it3@test.com"}], 0, 0, "ทดสอบ "ีกุ้งปิ้ง\" กิ้งปุ้ง", [{"name": "it2", "email": "it2@test.com"}], 0, {"name": "Normal", "level": 3}, "21:42", "2.8 KiB", [], 3, 0, 0]], "threaded": 0, "syncToken": "4-5", "unseenCount": 2, "uids": [3, 2]}
sogo-wrong.json (711 bytes)   

Related Changesets

sogo: master a5d18bfc

2022-03-29 14:39

francis


Details Diff
fix(core): improve escaping of double-quotes

Fixes 0005351
Affected Issues
0005351
mod - SoObjects/SOGo/NSString+Utilities.m Diff File

Issue History

Date Modified Username Field Change
2021-07-05 14:59 atsawin New Issue
2021-07-05 14:59 atsawin Tag Attached: json
2021-07-05 14:59 atsawin Tag Attached: webmail
2021-07-05 14:59 atsawin File Added: sogo-correct.json
2021-07-05 14:59 atsawin File Added: sogo-wrong.json
2022-02-11 15:50 francis Description Updated
2022-02-11 15:50 francis Steps to Reproduce Updated
2022-03-29 14:40 francis Changeset attached => sogo master a5d18bfc
2022-03-29 14:40 francis Assigned To => francis
2022-03-29 14:40 francis Resolution open => fixed
2022-03-29 14:43 francis Status new => resolved
2022-03-29 14:43 francis Fixed in Version => 5.6.0