Closed Bug 1630688 Opened 5 years ago Closed 2 years ago

For emails with two nested S/MIME signatures the inner signed data isn't shown (e.g. PEC email).

Categories

(Thunderbird :: Message Reader UI, defect)

defect

Tracking

(thunderbird_esr102+ affected, thunderbird110 affected)

RESOLVED FIXED
111 Branch
Tracking Status
thunderbird_esr102 + affected
thunderbird110 --- affected

People

(Reporter: massimo.marin, Assigned: KaiE)

References

(Regression)

Details

(Keywords: regression, testcase)

Attachments

(10 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/75.0

Steps to reproduce:

  • i open the new email and read body of email
  • i open "postacert.eml" attachment and read body of email
  • i open "copia.eml" attachment but it's shown as empty boby/attachment

Actual results:

"copia.email" is shown as empty body/attachment but by "view source" it's not empty so i need to save "copia.eml" on disk and then i can read the body and attachment of orginal email forwarded

Expected results:

"copia.eml" should be shown with body and attachments right not blank

Resetting severity to default of --.

Because this bug's Severity has not been changed from the default since it was filed, and it's Priority is -- (Backlog,) indicating it has has not been previously triaged, the bug's Severity is being updated to -- (default, untriaged.)

Severity: normal → --

Reporter, do. you still see this when using version 78?

Whiteboard: [closeme 2021-03-20]

Resolved per whiteboard

Status: UNCONFIRMED → RESOLVED
Closed: 4 years ago
Resolution: --- → INCOMPLETE
Whiteboard: [closeme 2021-03-20]

Hi,
I am having the same issue with others Italian PEC and confirm the above attachment "POSTA CERTIFICATA Messaggio PEC inoltrato [POSTA CERTIFICATA x max].eml" still have the issue with

Thunderbird 78.14.0 debian stable
Thunderbird-91.1_20210924213438.AppImage downloaded from https://github.com/srevinsaju/thunderbird-appimage/releases

I try to explain again the steps:

  • Open POSTA CERTIFICATA Messaggio PEC inoltrato [POSTA CERTIFICATA x max].eml
    Here only 2 attachments are shown (postacert.eml and copia.eml, total size 2.5 kB) and the body text of copia.eml is empty.
    Opening copia.eml shows an empty message (no attachments and inline text)
  • Save postacert.eml to disk and open it from there.
    postacert.eml now shows 4 attachments (one is a RN-TB.pdf, total size 1.1 MB)

I also attach some screenshots

Only few of these email have this issue, but in Italy they are considered "Registered mail" with legal value as soon as they are received (so even if you do not open or read)

Thanks

luca are you able to reproduce using version 91?

Flags: needinfo?(d10c5f2d-3f0b-4289-a620-ce3627a137a6)

hi

issue still present even with TB 91.4.1 (64 bit)

MM

(In reply to Wayne Mery (:wsmwk) from comment #9)

luca are you able to reproduce using version 91?

As for me the issue persist with Thunderbird-91.4_20211216022855.AppImage (it's 91.4.1 as previous report)

Flags: needinfo?(d10c5f2d-3f0b-4289-a620-ce3627a137a6)
Status: RESOLVED → REOPENED
Ever confirmed: true
Resolution: INCOMPLETE → ---

still present with Thuderdirb 102.3.0 (debian stable)

Flags: needinfo?(mkmelin+mozilla)
Keywords: testcase

Perhaps Kai has some idea.

Flags: needinfo?(mkmelin+mozilla) → needinfo?(kaie)

I'm sorry that I haven't been able to investigate this bug earlier.
I've started to investigate today.

In the given examples, an email has another email attached.
When trying to open the nested email, we don't show the message contents.

There are two S/MIME signatures involved here. A signature for the outer layer, and another signature for an inner layer.

I performed a few experiments by manually modifying the messages.

Experiment 1:
If I remove the outer S/MIME signature, and keep everything else, we correctly show all parts of the message.

Experiment 2:
If I remove the inner S/MIME signature, and keep everything else, we also correctly show all parts of the message.

I need to investigate how the presence of more than one S/MIME signature causes the incorrect message processing.

Assignee: nobody → kaie
Status: REOPENED → NEW
Flags: needinfo?(kaie)
Attached file 1630688-repro.eml

Minimal testcase.

The text "level 2" from the attached message is not shown.
The text should be shown after we fix the bug.

This is a modified version of the minimal testcase.
The inner S/MIME signature layer is removed.
The "level 2" text is shown.

This demonstrates that we can show the contents of nested messages in general, but this bug (triggered by the second signature) prevents it from being shown.

Attachment #9312283 - Attachment description: WIP: Bug 1630688 - Better handling of nested S/MIME signatures. → Bug 1630688 - Better handling of nested S/MIME signatures. r=mkmelin
Summary: unable read the original email forwarded as eml attachment (PEC email) → Emails with two nested S/MIME signatures don't show the inner signed data (e.g. PEC email).
Summary: Emails with two nested S/MIME signatures don't show the inner signed data (e.g. PEC email). → For emails with two nested S/MIME signatures the inner signed data isn't shown (e.g. PEC email).

I have a fix. It works on the esr102 branch.
I'll test comm-central soon, too.

TODO. Turn the attached testcase into an automated test (check that text "level 2" is shown).

Keywords: regression
Regressed by: CVE-2019-11755

Test is trivial. Maybe we can get both fix and test checked in before the Monday merge?

I was too optimistic, test doesn't work on comm-central.

Ok, test patch updated to work on c-c.

Blocks: 1531735
Attachment #9312375 - Attachment description: Bug 1630688 - Test rendering of nested message with nested S/MIME signature. r=mkmelin → Bug 1630688 - Test rendering of nested message with nested S/MIME signature. r=darktrojan

This missed the merge, I'd like to nominate for beta once landed.

Flags: needinfo?(kaie)
Flags: needinfo?(kaie)

(In reply to Kai Engert (:KaiE:) from comment #27)

This missed the merge, I'd like to nominate for beta once landed.

Well, we're close to the next beta cycle, so probably sufficient to have it ride the train to beta.

Status: NEW → ASSIGNED
Target Milestone: --- → 111 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/dbe439ccd783
Better handling of nested S/MIME signatures. r=mkmelin
https://hg.mozilla.org/comm-central/rev/1574b0e6b27d
Test rendering of nested message with nested S/MIME signature. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago2 years ago
Resolution: --- → FIXED

This breaks existing S/MIME unit tests.
We should back out, I need to carefully review how the existing tests should be adjusted.

Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Backout by martin@humanoids.be: https://hg.mozilla.org/comm-central/rev/682d2ef4f057 Backed out changeset 1574b0e6b27d for causing test failures. r=backout DONTBUILD https://hg.mozilla.org/comm-central/rev/34c8f6c951c0 Backed out changeset dbe439ccd783 for causing test failures. r=backout DONTBUILD

https://hg.mozilla.org/comm-central/rev/dbe439ccd783
Better handling of nested S/MIME signatures. r=mkmelin

This revision (now backed out) had caused an unwanted change of behavior in some scenarios.

If a message contained two S/MIME signatures (outer and inner), we had always reported the message as having an invalid signature.
(This makes sense, if an attacker wraps their own signature around encrypted contents they cannot read, the attacker's signature shouldn't be shown as valid on the decrypted contents.)

However, the above revision would allow exactly that to happen, so I'm glad the test caught that change in behavior.

I'll update the patch to always report a broken signature status for the nested scenarios.

Attachment #9312375 - Attachment description: Bug 1630688 - Test rendering of nested message with nested S/MIME signature. r=darktrojan → Bug 1630688 - Test rendering of nested message with nested S/MIME signature. r=mkmelin

Pushed by kaie@kuix.de:
https://hg.mozilla.org/comm-central/rev/e3bf99432ff8
Better handling of nested S/MIME signatures. r=mkmelin
https://hg.mozilla.org/comm-central/rev/e14039312c0a
Test rendering of nested message with nested S/MIME signature. r=mkmelin

Status: REOPENED → RESOLVED
Closed: 2 years ago2 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: