Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1342665 - CVE-2016-4475 - API and UI org/locations actions not limited to user's associated orgs/locations
Summary: CVE-2016-4475 - API and UI org/locations actions not limited to user's associ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Security
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: Unspecified
Assignee: Marek Hulan
QA Contact: jcallaha
URL:
Whiteboard:
Depends On:
Blocks: CVE-2016-4475
TreeView+ depends on / blocked
 
Reported: 2016-06-03 19:53 UTC by Bryan Kearney
Modified: 2019-09-25 21:19 UTC (History)
5 users (show)

Fixed In Version: foreman-1.11.0.50-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-08-16 07:10:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 15268 0 None None None 2016-06-03 19:53:37 UTC
Red Hat Product Errata RHBA-2016:1615 0 normal SHIPPED_LIVE Satellite 6.2.1 bug fix update 2016-08-16 11:09:48 UTC

Description Bryan Kearney 2016-06-03 19:53:35 UTC
A number of API and UI actions/URLs for viewing and managing organisations and locations are not limited to the orgs/locations assigned directly to the user, instead they are only restricted by permissions assigned to the user's roles.

* API index calls: GET /api/v2/organizations, GET /api/v2/locations
* API show/update/destroy calls
* UI edit/update/destroy calls

The UI index for orgs/locations and the UI org/location switcher appears to be the only place where the user's associated orgs/locations are taken into account.

Both UI and API controllers should be overriding methods for resource scopes to limit them further to the Organization.my_organizations/Location.my_locations scopes.

+Mitigation+: ensure all org/location related permissions assigned to a user are restricted to certain orgs/locations, these should still be taken into account.

Thanks to Ivan Necas for reporting this to foreman-security.

Comment 1 Bryan Kearney 2016-06-03 19:53:40 UTC
Created from redmine issue http://projects.theforeman.org/issues/15268

Comment 2 Bryan Kearney 2016-06-03 19:53:44 UTC
Upstream bug assigned to mhulan

Comment 4 Bryan Kearney 2016-06-23 08:14:54 UTC
Moving to POST since upstream bug http://projects.theforeman.org/issues/15268 has been closed

Comment 5 Marek Hulan 2016-08-02 08:31:13 UTC
Eric, it seems that only Foreman part was cherry-picked but Katello needs a fix too, otherwise tests are broken. The revision is not associated from Katello repo for some reason, could you please CP https://github.com/Katello/katello/pull/6129/commits/494221ef7957cacc05bd2ad24b6a58060e5bd65a or let me know how should I proceed? Thank you.

Comment 6 Eric Helms 2016-08-08 19:27:59 UTC
Marek,

Once the Katello unit tests ran, they failed and we discovered the test fix was needed and they were added. Looking at the timeline seems you noticed they earlier than we did we just didn't see the comment before we saw the test failures.

Comment 7 jcallaha 2016-08-08 20:26:10 UTC
Verified in Satellite 6.2.1 Snap 1.1

After creating a new user "test" was created and assigned only to organization "test" and location "test". The user was successfully limited to viewing/editing orgs and locations in UI. The same is true for API. 

GET /katello/api/organizations
"results": [
    {
      "label": "test",
      "created_at": "2016-08-08 19:57:24 UTC",
      "updated_at": "2016-08-08 19:57:24 UTC",
      "id": 3,
      "name": "test",
      "title": "test",
      "description": ""
    }
  ]

PUT /katello/api/organizations/1 (Default Org)
{
  "error": {
    "message": "Resource organization not found by id '1'"
  }
}

GET /api/locations
"results": [
    {
      "ancestry": null,
      "parent_id": null,
      "parent_name": null,
      "created_at": "2016-08-08 19:58:16 UTC",
      "updated_at": "2016-08-08 19:58:16 UTC",
      "id": 4,
      "name": "test",
      "title": "test",
      "description": ""
    }
  ]

PUT /api/locations/2 (Default)
{
  "error": {
    "message": "Resource location not found by id '2'"
  }
}

Comment 9 errata-xmlrpc 2016-08-16 07:10:31 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-2016:1615


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