Bug 740090 - Sysconfig key handling can be used to read/write to/from any file on the system
Summary: Sysconfig key handling can be used to read/write to/from any file on the system
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: matahari
Version: 6.2
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Adam Stokes
Depends On:
TreeView+ depends on / blocked
Reported: 2011-09-20 21:36 UTC by Russell Bryant
Modified: 2011-12-06 11:43 UTC (History)
3 users (show)

Fixed In Version: matahari-0.4.4-6.el6
Doc Type: Bug Fix
Doc Text:
No description required.
Clone Of:
Last Closed: 2011-12-06 11:43:23 UTC

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:1569 normal SHIPPED_LIVE matahari bug fix and enhancement update 2011-12-06 00:39:06 UTC

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

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 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.


Note You need to log in before you can comment on or make changes to this bug.