X-Unsent EML with repeated From fields triggers quadratic JSMime parsing
Categories
(MailNews Core :: MIME, defect)
Tracking
(thunderbird_esr153 wontfix, thunderbird160 wontfix)
People
(Reporter: tjddbdud1, Assigned: mkmelin)
References
Details
Attachments
(1 file, 1 external file)
|
12.10 KB,
application/x-zip-compressed
|
Details |
Opening a crafted .eml with X-Unsent: 1 and many physical From fields
causes quadratic main-thread work and extreme transient allocation.
Proposed: Moderate, CWE-407/CWE-400, CVSS 3.1 6.5
(AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H).
Tested on Daily 160.0a1 build 20261016104433, Windows 11 x64.
Current source: b73b6c419d08c583d9ac32ed9f79b080c17856b6.
MailUtils.openEMLFile() checks X-Unsent and calls headers.get("from").
jsmime.mjs:140-144 combines every physical value with a growing-array
results.concat(...). For n one-address fields it copies at least n(n+1)/2
references synchronously before the compose window is usable.
Three fresh 120,000-field real-EML targets (3.96 MB) took 3.619-5.129 s
and added 909 MB-1.168 GB resident memory. Same-address folded controls took
0.163-0.169 s and 63-72 MB. The isolated current parser at 160,000 values
took 8.395 s versus 0.594 s for linear append; both returned 160,000 entries.
Bug 1411720 was fixed escaping inside one malformed value. Private Bug
2081101 is concat inside one address group. This is the separate outer
reducer across many physical fields with a verified X-Unsent consumer.
The ZIP contains the real-EML and parser PoCs, runners, all measurements,
branch/source evidence, duplicate analysis, and remediation. It is local-only
and synthetic. SHA-256:
1A905F7B27D67B611695E4A5CF27AAF61662E7C5113AFE1B47327BA7FA52B63E
| Assignee | ||
Comment 1•22 days ago
|
||
Not really a security issue.
| Assignee | ||
Comment 2•22 days ago
|
||
Also stop passing an unused (and would be wrong, we were not passing a string) from value
when opening X-Unsent .eml files for composition.
| Assignee | ||
Updated•20 days ago
|
Pushed by daniel@thunderbird.net:
https://hg.mozilla.org/comm-central/rev/e9126b59d6d0
Use flatMap when combining header values in jsmime. r=tobyp
Description
•