Closed
Bug 76463
Opened 24 years ago
Closed 23 years ago
formpost files should use 600, not 666, for permissions
Categories
(Core :: DOM: Core & HTML, defect, P1)
Tracking
()
VERIFIED
FIXED
mozilla0.9.7
People
(Reporter: j, Assigned: bzbarsky)
References
()
Details
(Keywords: privacy)
Attachments
(1 file, 1 obsolete file)
12.22 KB,
patch
|
alexsavulov
:
review+
darin.moz
:
superreview+
|
Details | Diff | Splinter Review |
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.3-ac9 i686; en-US; 0.8.1) Gecko/20010412
BuildID: 2001041214
When a file is uploaded through a form, Mozilla creates a /tmp/formpost file (or
formpost-xxx to avoid overwriting) .
This file is created with the 666^~umask perms. On most distros, the standard
umask is 022, therefore, /tmp/formpost* files are world readable. As they can
hold private content, this is an insecure behavior.
Reproducible: Always
Steps to Reproduce:
1.Upload a file through a form
2.Read /tmp/formpost
Actual Results: Any user can read the posted data.
Expected Results: Permissions should be enforced to 600
Assignee | ||
Comment 1•24 years ago
|
||
This is technically a dup of bug 15320. But that bug has recently gotten
futured, so the correct solution (not creating temp files) is not going to
happen anytime soon.
confirming this bug as a request to just change the file permissions. In that
form, nominating for beta1 and mozilla0.9.1 as a major security hole.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Uploading a file exposes its content to other users → formpost files should use 600, not 666, for permissions
Comment 3•24 years ago
|
||
Unfutured the other bug. Marking this a dup. Time to clean this up...
*** This bug has been marked as a duplicate of 15320 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Assignee | ||
Comment 5•23 years ago
|
||
Reopening since this is a much more serious issue than bug 15320 and that bug is
nowhere close to being fixed.
Status: VERIFIED → REOPENED
Resolution: DUPLICATE → ---
Comment 6•23 years ago
|
||
taking
Assignee: pollmann → darin
Status: REOPENED → NEW
Priority: -- → P1
Target Milestone: --- → mozilla0.9.7
Assignee | ||
Comment 7•23 years ago
|
||
Comment 8•23 years ago
|
||
this patch looks good, except it might be really nice to take this time to
switch over to using nsIFile instead of nsFileSpec (since you are switching from
nsIFileSpec to nsFileSpec... might as well do the right thing and switch to
nsIFile).
Assignee | ||
Comment 9•23 years ago
|
||
I was trying to, actually, but I see no way to do the equivalent of MakeUnique()
with nsIFile. I suppose I could roll my own.... would that be better than
using nsFileSpec for this functionality?
Comment 10•23 years ago
|
||
-> bz, pointed him to nsIFile::CreateUnique... he's going to work on a new patch
that uses nsIFile :)
Assignee: darin → bzbarsky
Assignee | ||
Comment 11•23 years ago
|
||
CreateUnique is a bastard child that doesn't do what you'd expect it to... But
if you treat it right, it _can_ do the right thing. :)
Attachment #59911 -
Attachment is obsolete: true
Assignee | ||
Comment 12•23 years ago
|
||
Alexandru, would you review?
Comment 13•23 years ago
|
||
Comment on attachment 59981 [details] [diff] [review]
Patch using nsIFile
sr=darin
BTW it's valid to write NS_ADDREF(*aMultipartDataFile = tempDir)... NS_ADDREF
actually corresponds to an inline function :)
Attachment #59981 -
Flags: superreview+
Comment 14•23 years ago
|
||
Comment on attachment 59981 [details] [diff] [review]
Patch using nsIFile
r= alexsavulov
OPTIONAL:
could we use everywhere nsIFile and get rid of nsIFileSpec usage?
Attachment #59981 -
Flags: review+
Assignee | ||
Comment 15•23 years ago
|
||
Yes, but that's a separate bug... :)
Assignee | ||
Comment 16•23 years ago
|
||
checked in
Status: NEW → RESOLVED
Closed: 24 years ago → 23 years ago
Resolution: --- → FIXED
Updated•6 years ago
|
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•