Closed Bug 1780123 Opened 2 years ago Closed 2 years ago

OpenPGP: Action "Decrypt and Save As" on encrypted attachment creates corrupt file

Categories

(MailNews Core :: Security: OpenPGP, defect)

Thunderbird 102
defect

Tracking

(thunderbird_esr91 unaffected, thunderbird_esr102+ fixed, thunderbird103 affected)

RESOLVED FIXED
104 Branch
Tracking Status
thunderbird_esr91 --- unaffected
thunderbird_esr102 + fixed
thunderbird103 --- affected

People

(Reporter: nick632545, Assigned: KaiE)

References

(Regression)

Details

(Keywords: regression)

Attachments

(2 files)

Steps to reproduce:

1.) Create a zip archive with 2 or more files
2.) Encrypt zip archive (in my case I used gpg command line tools)
3.) Create an email, attach encrypted zip archive (no need to encrypt the actual message) and send.

I am on a mac, running Big Sur (11.6.7)

In my contrived test, I am running:
gpg (GnuPG/MacGPG2) 2.2.34
libgcrypt 1.8.9

Utilizing the standard mac compression tool.

It should be noted that I've also utilized Ubuntu 18.04, Python 3.8.2 (shutil.make_archive) with gnupg module and the issue remains (I don't think this is a mac problem).

Actual results:

1.) Right click on attachment, select "Decrypt and Save As"
2.) Decompress zip archive (this fails due to file corruption - Inappropriate file type or format)

Expected results:

A proper zip archive would be written to disk, which would permit decompression. It should be noted that if I right click on the attachment and select Save As, the gpg file will be written to disk, I can subsequently decrypt and then unzip the archive and it works fine.

FWIW, this issue is not present in Thunderbird 91.11.0 (64-bit) running on Ubuntu 18.04.

Component: Untriaged → Security: OpenPGP
Product: Thunderbird → MailNews Core
Assignee: nobody → kaie
Status: UNCONFIRMED → NEW
Ever confirmed: true
Regressed by: 1677088

I can reproduce and have a fix.

Bug isn't specific to external gnupg - can be reproduced with internal RNP decryption, too.

Summary: Decrypt and Save As of gpg file corrupts underlying zip attachment → OpenPGP: Action "Decrypt and Save As" on encrypted attachment creates corrupt file
Attached patch 1780123-esr102.patch (deleted) — Splinter Review
Status: NEW → ASSIGNED
Target Milestone: --- → 104 Branch

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/0f3ed268cea0
Fix decryption of binary attachments. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

Comment on attachment 9286531 [details]
Bug 1780123 - Fix decryption of binary attachments. r=mkmelin

[Approval Request Comment]
Regression caused by (bug #): 1677088
User impact if declined: broken functionality
Testing completed (on c-c, etc.):
Risk to taking this patch (and alternatives if risky): low

Attachment #9286531 - Flags: approval-comm-beta?
Attachment #9286532 - Flags: approval-comm-esr102?

Comment on attachment 9286531 [details]
Bug 1780123 - Fix decryption of binary attachments. r=mkmelin

[Triage Comment]
Approved for beta

Attachment #9286531 - Flags: approval-comm-beta? → approval-comm-beta+
Whiteboard: [TM:102.2.0]
Whiteboard: [TM:102.2.0]

Comment on attachment 9286531 [details]
Bug 1780123 - Fix decryption of binary attachments. r=mkmelin

[Triage Comment]
already on beta 104 via merge

Attachment #9286531 - Flags: approval-comm-beta+ → approval-comm-beta-

Comment on attachment 9286532 [details] [diff] [review]
1780123-esr102.patch

[Triage Comment]
Approved for esr102

Attachment #9286532 - Flags: approval-comm-esr102? → approval-comm-esr102+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: