Bug 740090

Summary: Sysconfig key handling can be used to read/write to/from any file on the system
Product: Red Hat Enterprise Linux 6 Reporter: Russell Bryant <rbryant>
Component: matahariAssignee: Adam Stokes <astokes>
Status: CLOSED ERRATA QA Contact: IDM QE LIST <seceng-idm-qe-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.2CC: dajohnso, matahari-maint, zbitter
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: matahari-0.4.4-6.el6 Doc Type: Bug Fix
Doc Text:
No description required.
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-12-06 11:43:23 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 Russell Bryant 2011-09-20 21:36:42 UTC
Description of problem:

The handling of keys needs to do some path sanitizing so that it _only_ creates files in the directory used to hold the keys and that it only reads files in this keys directory as well.

Right now, you can include things like "../../../etc/whatever" as the key and you can get the agent to either:

1) return the contents of any file on the system using the is_configured method

2) write over any file on the system if you use run_uri or run_string

I don't consider this a security problem or anything given that this is an agent that has full access to run puppet and update the system anyway, but the key handling really should be more sandboxed than it is.

Comment 2 Zane Bitter 2011-09-21 09:06:10 UTC
I made some suggestions here: https://fedorahosted.org/pipermail/matahari/2011-July/001485.html

Comment 3 Adam Stokes 2011-09-23 21:03:52 UTC
http://git.io/i82Whg

Comment 6 Dave Johnson 2011-09-27 22:31:59 UTC
good 2 go in v0.4.4-6

qmf: call 1 is_configured /etc/passwd
Output Parameters:
    Name    Value
    =================
    status  unknown

qmf: call 1 run_uri http://127.0.0.1/sysconfig-test 1 puppet /etc/passwd
/usr/bin/qmf-tool:139: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
  if e.message.__class__ == qmf2.Data:
Exception in call command: From Remote Agent: {'error_text': 'Invalid Arguments'}

Comment 7 Russell Bryant 2011-11-16 22:28:22 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
No description required.

Comment 8 errata-xmlrpc 2011-12-06 11:43:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2011-1569.html