Bug 176939 - Security leak: tokens get created with insecure permissions
Summary: Security leak: tokens get created with insecure permissions
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Geclipse (show other bugs)
Version: unspecified   Edit
Hardware: PC All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Mathias Stümpert CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed, core
Depends on:
Blocks:
 
Reported: 2007-03-11 10:04 EDT by Ariel Garcia CLA
Modified: 2014-01-09 16:18 EST (History)
0 users

See Also:


Attachments
SecureFile class and toke creation patches (14.15 KB, patch)
2007-03-11 10:09 EDT, Ariel Garcia CLA
aog-ecl: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ariel Garcia CLA 2007-03-11 10:04:42 EDT
Currently the grid-proxy and voms-proxy files get created without setting the file permissions. Therefore if the OS is multiuser and the user has an insecure file creation default (umask) the token files could end up readable by other users.

Sadly there is no way to manage file/folder permissions in Java <= 5 or in Eclipse itself (class org.eclipse.core.resources.ResourceAttributes doesn't manage user/other permissions either), and requiring Java 6 is right now not an option. Asking the user to set the "umask" before launching gEclipse would also be silly if we can take care of it. Therefore it looks to me that the only way around is using platform-specific code for taking care of that.
The attached patch tries to solve the issue, creating a new SecureFile class which extends java.io.File, and which can be used to set secure file permissions. The implementation misses the windows part but "works-for-me" in linux with grid-proxys.
This patch protects the grid and voms proxy files and also the .tokens folder, just in case...
Comment 1 Ariel Garcia CLA 2007-03-11 10:09:02 EDT
Created attachment 60516 [details]
SecureFile class and toke creation patches
Comment 2 Ariel Garcia CLA 2007-03-14 14:41:27 EDT
Patch commited now, please make sure it doesn't break in Windows
Comment 3 Mathias Stümpert CLA 2007-03-21 04:50:26 EDT
applied path without any problems. seems to cause no problems under windows.
Comment 4 Mathias Stümpert CLA 2007-05-31 07:27:33 EDT
closing this ticket