Bugzilla will be upgraded to version 5.0 on a still to be determined date in the near future. The original upgrade date has been delayed.
Bug 1322050 - (CVE-2016-3072) CVE-2016-3072 Katello: Authenticated sql injection via sort_by and sort_order request parameter
CVE-2016-3072 Katello: Authenticated sql injection via sort_by and sort_order...
Status: CLOSED ERRATA
Product: Security Response
Classification: Other
Component: vulnerability (Show other bugs)
unspecified
All Linux
high Severity high
: ---
: ---
Assigned To: Red Hat Product Security
impact=important,public=20160516,repo...
: Security
Depends On: 1321635 1350803
Blocks: 1322054
  Show dependency treegraph
 
Reported: 2016-03-29 12:05 EDT by Kurt Seifried
Modified: 2016-06-28 10:53 EDT (History)
14 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
An input sanitization flaw was found in the scoped search parameters sort_by and sort_order in the REST API. An authenticated user could use this flaw to perform an SQL injection attack on the Katello back end database.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-01 15:34:11 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2016:1083 normal SHIPPED_LIVE Important: ruby193-rubygem-katello security update 2016-05-16 19:15:49 EDT

  None (edit)
Description Kurt Seifried 2016-03-29 12:05:39 EDT
Description of problem:

The foreman & Katello projects received an upstream notification about the discovery of an authenticated sql injection vulnerability within katello:

Dear Katello/Foreman Team,

During an internal test it was discovered that the scoped search
parameters sort_by and sort_order are vulnerable to an authenticated SQL
injection.

If we access:
https://x.x.x.x/katello/api/v2/organizations/1/sync_plans/1/products?available_for=sync_plan&full_result=true&page=1&search=&sort_by=name&sort_order=ASC'

we will see the following error:

{"displayMessage":"PG::Error: ERROR:  unterminated quoted string at or
near \"', katello_products.id <http://katello_products.id> DESC\"\nLINE
1: ...n_id IS NULL))  ORDER BY katello_products.name
<http://katello_products.name> ASC', katello...\n
                                      ^\n: SELECT \"katello_products\".*
FROM \"katello_products\"  WHERE \"katello_products\".\"id\" IN (SELECT
DISTINCT \"katello_products\".\"id\" FROM \"katello_products\"  WHERE
\"katello_products\".\"organization_id\" = 1 AND (katello_products.id
<http://katello_products.id> in (NULL) or katello_products.id
<http://katello_products.id> in (6,5,4,2,3,1)) AND (sync_plan_id != '1'
OR sync_plan_id IS NULL))  ORDER BY katello_products.name
<http://katello_products.name> ASC', katello_products.id
<http://katello_products.id> DESC","errors":["PG::Error: ERROR:
unterminated quoted string at or near \"', katello_products.id
<http://katello_products.id> DESC\"\nLINE 1: ...n_id IS NULL))  ORDER BY
katello_products.name <http://katello_products.name> ASC', katello...\n


The injection can be exploited as a blind time based injection.

Best Regards
Oliver

External reference:
The line of code in question here is:  https://github.com/Katello/katello/blob/KATELLO-3.0/app/controllers/katello/api/v2/api_controller.rb#L67
Comment 2 errata-xmlrpc 2016-05-16 15:16:04 EDT
This issue has been addressed in the following products:

  Red Hat Satellite 6.1

Via RHSA-2016:1083 https://access.redhat.com/errata/RHSA-2016:1083

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