Closed Bug 1753242 Opened 3 years ago Closed 3 years ago

thunderbird 91.5.0 writes attachments to /tmp readable to everyone

Categories

(Thunderbird :: General, defect)

Thunderbird 91
defect

Tracking

(thunderbird_esr91+ verified, thunderbird97 wontfix, thunderbird98+ verified)

VERIFIED FIXED
99 Branch
Tracking Status
thunderbird_esr91 + verified
thunderbird97 --- wontfix
thunderbird98 + verified

People

(Reporter: pierre.sauter, Assigned: mkmelin)

References

(Regression)

Details

(Keywords: privacy, regression, Whiteboard: [regression: TB96])

Attachments

(2 files)

Steps to reproduce:

open an attachment (png) with the associated app

Actual results:

the file is saved to /tmp readable to everyone

Expected results:

a protected subdirectory /tmp/mozilla_${user}0 should be created and the file saved there

References:

old bug that led to the mozilla_$user subdirectory:
https://bugzilla.mozilla.org/show_bug.cgi?id=377630

Ubuntu bug report:
https://bugs.launchpad.net/ubuntu/+source/thunderbird/+bug/1959604

Status: UNCONFIRMED → NEW
Component: Untriaged → General
Ever confirmed: true
Keywords: regression
Regressed by: 1737711
Assignee: nobody → mkmelin+mozilla
Status: NEW → ASSIGNED

Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/2f7ca550aed8
use a tmp subdir for opening temp files. r=darktrojan

Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 99 Branch

Comment on attachment 9262175 [details]
Bug 1753242 - use a tmp subdir for opening temp files. r=darktrojan

[Approval Request Comment]
Regression caused by (bug #): bug 1737711
User impact if declined: information leak possible for multi-user systems
Testing completed (on c-c, etc.): c-c
Risk to taking this patch (and alternatives if risky): some risk of unexpected behavior

Attachment #9262175 - Flags: approval-comm-esr91?
Attachment #9262175 - Flags: approval-comm-beta?
Keywords: privacy
Whiteboard: [regression: TB96]

Comment on attachment 9262175 [details]
Bug 1753242 - use a tmp subdir for opening temp files. r=darktrojan

[Triage Comment]
Approved for beta

Attachment #9262175 - Flags: approval-comm-beta? → approval-comm-beta+

Verified testing the 98.0b2 release candidate on Fedora 35 Workstation.

Status: RESOLVED → VERIFIED

Comment on attachment 9262175 [details]
Bug 1753242 - use a tmp subdir for opening temp files. r=darktrojan

[Triage Comment]
Approved for esr91

Attachment #9262175 - Flags: approval-comm-esr91? → approval-comm-esr91+

The test changes won't merge. The changes to msgHdrView.js apply fine. Uplifting without the tests seems like a bad idea, how do you want to proceed?

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

Sorry, still something to sort out with that.

Flags: needinfo?(mkmelin+mozilla)

fixed version for esr91 based on comment 11.

Diff to comment 11:

➜ hg diff
diff --git a/mail/test/browser/attachment/browser_openAttachment.js b/mail/test/browser/attachment/browser_openAttachment.js
--- a/mail/test/browser/attachment/browser_openAttachment.js
+++ b/mail/test/browser/attachment/browser_openAttachment.js
@@ -39,17 +39,17 @@ add_task(async function setupModule(modu
   be_in_folder(folder);
 
   // @see logic for tmpD in msgHdrView.js
   tmpD = PathUtils.join(
     Services.dirsvc.get("TmpD", Ci.nsIFile).path,
     "pid-" + Services.appinfo.processID
   );
 
-  let savePath = PathUtils.join(tmpD, "saveDestination");
+  savePath = PathUtils.join(tmpD, "saveDestination");
   await IOUtils.makeDirectory(savePath);
   Services.prefs.setStringPref("browser.download.dir", savePath);
 
   Services.prefs.setIntPref("browser.download.folderList", 2);
   Services.prefs.setBoolPref("browser.download.useDownloadDir", true);
   Services.prefs.setIntPref("security.dialog_enable_delay", 0);
 
   let mockedExecutable = FileUtils.getFile("TmpD", ["mockedExecutable"]);
@@ -406,12 +406,8 @@ add_task(async function saveToDiskPrompt
   let file = await checkFileSaved(tmpD);
   file.remove(false);
   Assert.ok(MockFilePicker.shown, "file picker was shown");
 
   MockFilePicker.reset();
   Services.prefs.setBoolPref("browser.download.useDownloadDir", true);
 });
 
-registerCleanupFunction(() => {
-  // Remove created folders.
-  folder.deleteSelf(null);
-});
Attachment #9262175 - Flags: approval-comm-esr91+

Comment on attachment 9266065 [details] [diff] [review]
1753242_esr91.patch

[Triage Comment]
Previously approved by wsmwk; moving flag to esr91 version of patch.

Attachment #9266065 - Flags: approval-comm-esr91+
Flags: needinfo?(mkmelin+mozilla)

Verified the fix works on 91.7.0-build1, Linux64.

CVE-??:
     title: Opened attachments are saved world-readable
     impact: moderate
     reporter: Pierre Sauter 
     description: |
       Thunderbird 91.4.1-91.6.1 saves opened attachment files in the temporary directory with world-readable permissions.
     bugs:
       - url: 1753242

Kai - We'd like advisory for this bug.

Flags: needinfo?(kaie)

(In reply to Rob Lemley [:rjl] from comment #17)

Kai - We'd like advisory for this bug.

No advisory. This bug is mentioned in the release notes.

Flags: needinfo?(kaie)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: