Bug 1310054 (CVE-2016-2098)

Summary: CVE-2016-2098 rubygem-actionview, rubygem-actionpack: code injection vulnerability in Action View
Product: [Other] Security Response Reporter: Adam Mariš <amaris>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: unspecifiedCC: apatters, bkearney, cbillett, ccoleman, cpelland, dajohnso, dclarizi, dmcphers, gblomqui, gmccullo, gtanzill, jfrey, jhardy, jialiu, joelsmith, jokerman, jorton, jprause, jrusnack, kseifried, lmeyer, mmaslano, mmccomas, obarenbo, roliveri, security-response-team, tazz, tomckay, vondruch, xlecauch
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: rubygem-actionpack 3.2.22.2, rubygem-actionview 4.1.14.2, rubygem-actionview 4.2.5.2 Doc Type: Bug Fix
Doc Text:
A code injection flaw was found in the way Action View component searched for templates for rendering. If an application passed untrusted input to the 'render' method, a remote, unauthenticated attacker could use this flaw to execute arbitrary code.
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-15 21:20:09 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:
Bug Depends On: 1310233, 1310234, 1310235, 1310236, 1313387, 1313388, 1313389, 1315704, 1315705, 1316729    
Bug Blocks: 1310055    
Attachments:
Description Flags
Upstream patch
none
Upstream patch 3.2
none
Upstream patch 4.1
none
Upstream patch 4.2 none

Description Adam Mariš 2016-02-19 10:38:20 UTC
Code injection vulnerability in Action Pack was found, possibly leading to remote code execution. Applications that pass unverified user input to the `render` method in a controller may be vulnerable to a code injection.

Impacted code will look like this:

```ruby
class TestController < ApplicationController
  def show
    render params[:id]
  end
end
```

Carefully crafted request parameters, can be used to coerce the above example to execute arbitrary ruby code.

A workaround to this issue is to not pass arbitrary user input to the `render`
method. Instead, verify that data before passing it to the `render` method.

Versions Affected:  3.2.x, 4.0.x, 4.1.x, 4.2.x
Not affected:       5.0+
Fixed Versions:     3.2.22.2, 4.1.14.2, 4.2.5.2

Comment 1 Adam Mariš 2016-02-19 10:40:38 UTC
Acknowledgments:

Name: the Ruby on Rails project
Upstream: Tobias Kraze (makandra), joernchen (Phenoelit)

Comment 2 Adam Mariš 2016-02-19 10:41:23 UTC
Created attachment 1128508 [details]
Upstream patch

Comment 5 Adam Mariš 2016-03-01 13:51:09 UTC
Created attachment 1131939 [details]
Upstream patch 3.2

Comment 6 Adam Mariš 2016-03-01 13:52:47 UTC
Created attachment 1131942 [details]
Upstream patch 4.1

Comment 7 Adam Mariš 2016-03-01 13:54:58 UTC
Created attachment 1131943 [details]
Upstream patch 4.2

Comment 8 Adam Mariš 2016-03-01 13:58:47 UTC
Affected versions were changed, previous advisory listed these versions:

Versions Affected:  3.2.x, 4.0.x
Not affected:       4.1+
Fixed Versions:     3.2.22.2

Comment 10 Adam Mariš 2016-03-01 14:15:11 UTC
Created rubygem-actionpack tracking bugs for this issue:

Affects: fedora-all [bug 1313387]

Comment 12 Adam Mariš 2016-03-01 14:17:12 UTC
Created rubygem-actionpack tracking bugs for this issue:

Affects: epel-5 [bug 1313389]

Comment 16 Tomas Hoger 2016-03-11 08:53:21 UTC
hackerone report, but it fails to provide any additional information not already included in the upstream announcement:

https://hackerone.com/reports/113928

Comment 20 errata-xmlrpc 2016-03-15 20:59:17 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6

Via RHSA-2016:0456 https://rhn.redhat.com/errata/RHSA-2016-0456.html

Comment 21 errata-xmlrpc 2016-03-15 21:02:05 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS

Via RHSA-2016:0455 https://rhn.redhat.com/errata/RHSA-2016-0455.html

Comment 22 errata-xmlrpc 2016-03-15 21:05:08 UTC
This issue has been addressed in the following products:

  Red Hat Software Collections for Red Hat Enterprise Linux 7.2 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 7
  Red Hat Software Collections for Red Hat Enterprise Linux 7.1 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6
  Red Hat Software Collections for Red Hat Enterprise Linux 6.7 EUS
  Red Hat Software Collections for Red Hat Enterprise Linux 6.6 EUS

Via RHSA-2016:0454 https://rhn.redhat.com/errata/RHSA-2016-0454.html

Comment 23 Fedora Update System 2016-03-17 20:52:11 UTC
rubygem-actionpack-4.2.3-5.fc23, rubygem-actionview-4.2.3-5.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 24 Fedora Update System 2016-03-17 21:19:59 UTC
rubygem-actionpack-4.2.0-4.fc22, rubygem-actionview-4.2.0-5.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.