Bug 607352

Summary: saves user passwords/passphrases to a world-readable file
Product: [Fedora] Fedora Reporter: Bill Nottingham <notting>
Component: NetworkManager-openswanAssignee: Avesh Agarwal <avagarwa>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 13CC: avagarwa, rvokal, sgrubb
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 609595 (view as bug list) Environment:
Last Closed: 2011-06-27 18:50:08 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bill Nottingham 2010-06-23 21:28:23 UTC
Description of problem:

NM-openswan saves user passwords/passphrases to a world-readable file in /etc/ipsec.d.

1) it shouldn't be writing user connections to the global store
2) it certainly shouldn't be saving passphrases that are set to 'ask every time'
3) nor should it be saving them to a world-writable, plaintext file

Version-Release number of selected component (if applicable):

0.8.0-1.20100411git

How reproducible:

100%

Steps to Reproduce:
1. set up a connection
2. look in /etc/ipsec.d
 
Actual results:

Stuff.

Expected results:

No stuff.

Comment 1 Bill Nottingham 2010-06-23 21:28:45 UTC
make that 'world-readable' in #3 above.

Comment 2 Avesh Agarwal 2010-07-08 18:10:12 UTC
Built a new version of NetworkManager-openswan (NetworkManager-openswan-0.8.0-2.20100411git.fc14) to address this issue.

Comment 3 Bill Nottingham 2010-07-08 18:34:50 UTC
No. Putting them on the commandline where anyone (even unpriveleged people!) can get them from the process treee is probably worse.

Comment 4 Bill Nottingham 2010-07-08 18:39:28 UTC
Furthermore, this build:

- still saves the user's config to the filesystem
- still saves some of the secrets to the filesystem

Comment 5 Avesh Agarwal 2010-07-08 18:46:33 UTC
 (In reply to comment #4)
> Furthermore, this build:
> 
> - still saves the user's config to the filesystem
> - still saves some of the secrets to the filesystem    
Only sensitive user information is "user password", that is not being stored there now. Other information in the conf file and secret file is not really user information, but global information as ipsec works at system level.

Comment 6 Avesh Agarwal 2010-07-08 18:52:19 UTC
(In reply to comment #3)
> No. Putting them on the commandline where anyone (even unpriveleged people!)
> can get them from the process treee is probably worse.    

There are only 2 ways in Openswan to read the user password:

1. Writing it to a secret file, and then reading it, as it as done before.
2. Passing the user password as an argument to "ipsec whack", that is being done in the current version.

Openswan does not read configuration from standard input currently.

Comment 7 Bill Nottingham 2010-07-08 19:07:44 UTC
(In reply to comment #5)
>  (In reply to comment #4)
> > Furthermore, this build:
> > 
> > - still saves the user's config to the filesystem
> > - still saves some of the secrets to the filesystem    
> Only sensitive user information is "user password", that is not being stored
> there now. Other information in the conf file and secret file is not really
> user information, but global information as ipsec works at system level.    

Sure, the connection is global once it's activated. But it's a user's setting, and any secrets (some of which you're writing, such as the connection's PSK) should remain only 1) in  memory 2) encrypted. What you have now is neither... it's essentially violating why it would be saved in the user's keyring.

(In reply to comment #6)
> There are only 2 ways in Openswan to read the user password:
> 
> 1. Writing it to a secret file, and then reading it, as it as done before.
> 2. Passing the user password as an argument to "ipsec whack", that is being
> done in the current version.
> 
> Openswan does not read configuration from standard input currently.    

Then that needs to be fixed. Passing passwords on the commandline is a security 101 no-no.

Comment 8 Avesh Agarwal 2010-07-08 20:36:25 UTC
I have made a new build of NetworkManager-openswan, and it does not write to command line now, but now it writes to the secret file (600 permission) again. However, these files are removed after VPN connection is terminated.

Comment 9 Bill Nottingham 2010-07-08 20:40:38 UTC
That's missing the point. They *should not be written*, period.

Comment 10 Bill Nottingham 2010-07-08 21:33:46 UTC
Would it be possible to point openswan to /dev/stdin, and pipe the config file to it that way?

Comment 11 Avesh Agarwal 2010-07-13 23:24:35 UTC
As per discussions with Bill, I have made changes to NetworkManager-openswan, and the latest build is http://koji.fedoraproject.org/koji/buildinfo?buildID=183505 . Any feedback is appreciated.

Comment 12 Bill Nottingham 2010-07-14 16:25:28 UTC
Looks much better. You probably want to future-proof it for multiple VPN connections by not using a hardcoded filename, but NM doesn't support multiple VPNs yet, so it's not a huge priority.

Comment 13 Bug Zapper 2011-06-01 15:45:25 UTC
This message is a reminder that Fedora 13 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 13.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '13'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 13's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 13 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 14 Bug Zapper 2011-06-27 18:50:08 UTC
Fedora 13 changed to end-of-life (EOL) status on 2011-06-25. Fedora 13 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.