Open Bug 1946168 Opened 9 months ago Updated 24 days ago

Endless Loop Trying to Display a Specific Mailinglist Digest (with "view attachments inline")

Categories

(Thunderbird :: General, defect, P1)

Thunderbird 104

Tracking

(thunderbird_esr115 affected, thunderbird_esr128 affected, thunderbird136 affected, thunderbird137 affected)

REOPENED
138 Branch
Tracking Status
thunderbird_esr115 --- affected
thunderbird_esr128 --- affected
thunderbird136 --- affected
thunderbird137 --- affected

People

(Reporter: Jochen.Bern, Assigned: KaiE)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression, testcase, triaged, Whiteboard: [mailsec-broken-fixwanted])

Attachments

(5 files, 1 obsolete file)

Steps to reproduce:

Received and wanted to read an e-mail from the dovecot mailinglist (where I'm subscribed in digest mode).

TB 128.6.0esr (64-bit) on Fedora (KDE Spin) 40, Updates applied just this week, IMAP server is an M365 EXO, installed extensions: see attached screenshot.

Actual results:

TB attempts to render the e-mail and enters an endless loop (alternating between one pane content saying that DKIM verification is ongoing, and one warning that (only) parts of the e-mail are signed). UI remains reactive, I can end the loop by having another e-mail displayed. (319 kB screen video available.)

Hiding the message pane, I can select the e-mail in the list and save it to a file (not attached right now, I'm apparently limited to one attachment, sorry). Loading the file into TB again triggers the loop (it seems to loop faster then.)

Expected results:

Display the e-mail content in the message pane as usual.

Can't add another attachment to a later comment, either. I seem to able to "Forward As Attachment" from the Message List, though ...

Disabled all extensions, restarted TB, switched between Plain Text and Original HTML display modes, loop still happens (except a lot faster, and without the DKIM Verifier's status message, of course).

Please attach the message, as .eml (using the Attach New File button above).

Saved E-Mail as requested

No idea whether that's related, just mentioning it here in case it is: I just found that trying to create an e-mail from a saved template yields an e-mail editing window (screenshot upcoming) with just subject and recipients - no text, no signature ... ?

Open template, get empty mail body ...

Thanks for the testcase, I can reproduce that in daily
(Empty body was bug 1940605)

Severity: -- → S2
Status: UNCONFIRMED → NEW
Component: Mail Window Front End → General
Ever confirmed: true
Keywords: testcase, triaged
Priority: -- → P1
Keywords: regression
Version: Thunderbird 128 → Thunderbird 104

Great guess, backing that out fixes this!

Regressed by: 1773772

Bug 1878664 may be the same.

See Also: → 1878664

(In reply to Magnus Melin [:mkmelin] from comment #11)

Bug 1878664 may be the same.

It's the same underlying cause, since comment 10 applies there as well.

I suppose that this might well be related, too: I can reply to this S/MIME signed+crypted e-mail from my "Sent" folder, but when I try to forward it, the edit window comes up with an empty body (and the window displaying the original e-mail seems to flicker / get redisplayed for a moment).

Tried this with a signed-but-not-encrypted e-mail in my "Sent" folder (I autosign virtually all e-mails I send) and a SBNEE from someone else in my INBOX, same result.

Forwarding an S/MIME-free e-mail from my INBOX works as expected.

("Edit As New Message" doesn't work, either. Guess I'll be copy-pasting into a new e-mail and manually attaching the spreadsheet again now.)

Jochen, if you are still on 128.6.0 this seems to be bug 1940605, otherwise maybe bug 1843860.

(In reply to Magnus Melin [:mkmelin] from comment #11)

Bug 1878664 may be the same.

This is actually the same bug, duping to the older one.

Status: NEW → RESOLVED
Closed: 8 months ago
Duplicate of bug: 1878664
Resolution: --- → DUPLICATE
See Also: 1878664

As it turns out, bug 1878664 is just a subset of this problem.

Status: RESOLVED → REOPENED
Depends on: 1878664
No longer duplicate of bug: 1878664
Resolution: DUPLICATE → ---
Assignee: nobody → h.w.forms
Target Milestone: --- → 138 Branch

After applying the fix from bug 1878664,
to reproduce this bug it's necessary to have the setting "view attachments inline" enabled.

Summary: Endless Loop Trying to Display a Specific Mailinglist Digest → Endless Loop Trying to Display a Specific Mailinglist Digest (with "view attachments inline")

I'd like to explain/document what's happening.

Our code uses two alternative content-type handlers for the multipart/signed type.
Our C++ code registers the S/MIME code as the handler,
and our running JS code registers the OpenPGP handler.

Whenever we process a MIME part, the handler that was registered most recently will be used.
While processing that part, we check whether the protocol listed in the content-type matches the currently registered handler.
If there's a mismatch, we switch the registration to the other handler, and reload.

If the switch/reload was triggered by a subordinate mime part, and a parent part is of the other type, the reload and the repeated loading of the parent type will switch/reload again, resulting in the loop.

I think we should not switch/repeat when processing a subordinate mime part that isn't intended for display.
It's unnecessary and undesirable.
We don't automatically decrypt subordinate mime parts anyway.
We don't want to show the signature status of subordinate mime parts.

We should check whether the currently processed mime part is one of the top mime parts that we are trying to display.
Only in that scenario we should allow the reload.

When adding those checks, we need to be careful to handle the scenarios we're allowing.

I'll add more explanations later today.

I don't know yet, whether those better checks will be sufficient to fix this bug, or whether we need the proposed patch in addition.

I'm afraid we cannot use this bug as is. I suspect it would introduce a functional regression in the following scenario:

  • the most recently processed message,
    and consequently the currently registered content-type,
    if for OpenPGP
  • the user opens a message with an outermost S/MIME signature
  • that message contains an inner OpenPGP payload,
    as described in bug 1594253

To make that work, I believe the code currently relies on switching the content-type handler.

In the above scenario, the scenario from bug 1594253 will probably no longer work and the inner message no longer gets decrypted,
because it would depend on switching twice.

I'm not completely sure, we must test that scenario prior to landing.

I've filed bug 1955042 for a general rework of the multipart/signed content-type handler, which would avoid having to re-register and reload.

See Also: → 1955042

For the hotfix (prior to working on bug 1955042),
the following might be a sufficient fix:

  • if we're processing MIME part "1", then allow switch/reload

  • if we're processing MIME part "1.1" and top MIME part "1" contained multipart/signed,
    and 1.1 contains multipart/encrypted or multipart/signed, allow switch/reload

  • or, if we're processing MIME part "1.1" and top MIME part "1" contained multipart/encrypted,
    and 1.1 contains multipart/signed, allow switch/reload

I think in all other scenarios we should forbid switching.

Please see the pseudo code in the new attachment.

Attachment #9471112 - Attachment is obsolete: true

Thank you, Kai, for your in-depth analysis of this issue. Your much more precise approach definitely makes more sense.

Assignee: h.w.forms → kaie
Whiteboard: [mailsec-broken-fixwanted]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: