Bug 1434094 - com.redhat.RHSM1.Config.Set is accessible by non-root users
Summary: com.redhat.RHSM1.Config.Set is accessible by non-root users
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: subscription-manager
Version: 7.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Kevin Howell
QA Contact: Sean Toner
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-20 17:19 UTC by Kevin Howell
Modified: 2017-08-01 19:21 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-01 19:21:47 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github candlepin subscription-manager pull 1565 None None None 2017-03-20 18:00:24 UTC
Red Hat Product Errata RHBA-2017:2083 normal SHIPPED_LIVE python-rhsm and subscription-manager bug fix and enhancement update 2017-08-01 18:14:19 UTC

Description Kevin Howell 2017-03-20 17:19:17 UTC
Description of problem:
com.redhat.RHSM1.Config.Set can be called by any user.


How reproducible: 100%


Steps to Reproduce:
1. As non-root execute ex. gdbus call --system --dest=com.redhat.RHSM1 -o /com/redhat/RHSM1/Config -m com.redhat.RHSM1.Config.Set server.port "<'444'>"

Actual results:
Observe that port in rhsm.conf is changed


Expected results:
Non-root should not be able to alter rhsm.conf this way.

Comment 3 Sean Toner 2017-04-17 19:20:09 UTC
Tested this out on subscription-manager-1.19.7

Checked what the current port is:
=================================
[stoner@stoner-rhel-74 root]$ cat /etc/rhsm/rhsm.conf | grep "port ="
port = 443
proxy_port =

Switched to a non-root user
===========================
[stoner@stoner-rhel-74 root]$ su robin
Password: 
[robin@stoner-rhel-74 root]$ groups
robin

Tried to call config set service
================================
[robin@stoner-rhel-74 root]$ gdbus call --system --dest=com.redhat.RHSM1 -o /com/redhat/RHSM1/Config -m com.redhat.RHSM1.Config.Set server.port "<'444'>"
Error: GDBus.Error:org.freedesktop.DBus.Error.AccessDenied: Rejected send message, 3 matched rules; type="method_call", sender=":1.37940" (uid=1002 pid=12886 comm="gdbus call --system --dest=com.redhat.RHSM1 -o /co") interface="com.redhat.RHSM1.Config" member="Set" error name="(unset)" requested_reply="0" destination="com.redhat.RHSM1" (uid=0 pid=12113 comm="python /usr/libexec/rhsm-service ")

Switched to root, and checked that the conf file didn't change
==============================================================
[robin@stoner-rhel-74 root]$ su
Password: 
[root@stoner-rhel-74 ~]# cat /etc/rhsm/rhsm.cond | grep "port ="
cat: /etc/rhsm/rhsm.cond: No such file or directory
[root@stoner-rhel-74 ~]# cat /etc/rhsm/rhsm.conf | grep "port ="
port = 443
proxy_port =

As root, called the same command to set the port
================================================
[root@stoner-rhel-74 ~]# gdbus call --system --dest=com.redhat.RHSM1 -o /com/redhat/RHSM1/Config -m com.redhat.RHSM1.Config.Set server.port "<'444'>"
()

Verified the port was set as root user
======================================
[root@stoner-rhel-74 ~]# cat /etc/rhsm/rhsm.conf | grep "port ="
port = 444
proxy_port =

Comment 4 errata-xmlrpc 2017-08-01 19:21:47 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.

https://access.redhat.com/errata/RHBA-2017:2083


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