This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 143033 - base_dir/tomcat-users.xml is world-readable
Summary: base_dir/tomcat-users.xml is world-readable
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: Tomcat (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: Petr Hejl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-08-06 11:53 UTC by mslama
Modified: 2012-04-02 15:59 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mslama 2008-08-06 11:53:53 UTC
Original report is at https://bugs.launchpad.net/ubuntu/+source/netbeans/+bug/244321. I checked dev build but there is
tomcat 6. Not sure where to put this report if it is NetBeans or Tomcat issue. So please pass it accordingly.
Comment 1 Petr Hejl 2008-10-13 10:33:08 UTC
It is a development instance. Installer should place proper rights on file, however this won't solve issue in general.
Comment 2 mslama 2008-10-13 14:37:46 UTC
I do not think that any installer should create/set access rights to any file in user home directory (or default IDE
user dir). Who/when creates this file?
Comment 3 Thuy.d Nguyen 2009-01-08 22:30:19 UTC
Done a bit of investigation on NB 6.5 and found that 

- First scenario: If you select Tomcat that bundled with NB when you install NB 6.5 (and later version),  the file that
contains the Tomcat server manager's default username and password is stored in
~/.netbeans/6.5/apache-tomcat-6.0_base/config/tomcat-users.xml.  Although the file is world-readable, the password
inside the file is encrypted.
The entire folder ~/.netbeans/6.5/apache-tomcat-6.0_base which is the default ${Catalina_Base} chosen by NB is NOT
created at the time of NB installation, but at the time the Tomcat server is first started by users via NB
Servers->server node's popup menu.

- Second scenario: if you manually at Tomcat server to NB via the Add Server wizard, you are asked to enter username and
password for the manager role among other things. The username and password is stored in plain text in tomcat-users.xml
file under ${Catalina_Base}/config folder, where ${catalina_Base} is the folder you enter to the wizard.

Possible solutions:
- Option 1: encrypt the password in the second scenario before storing the password to tomcat-users.xml, then no need to
change the permission of the file.
- Option 2: Create the file (tomcat-users.xml) without word-readable perm, then no need to encrypt the password in
either scenarios.


Comment 4 Petr Hejl 2012-03-30 16:39:12 UTC
Fixed in web-main e0f3545105f5.
Comment 5 Quality Engineering 2012-04-02 15:59:02 UTC
Integrated into 'main-golden', will be available in build *201204021038* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/e0f3545105f5
User: Petr Hejl <phejl@netbeans.org>
Log: #143033 base_dir/tomcat-users.xml is world-readable