CVE-2012-1182: "root" credential remote code execution

Bug #978458 reported by Rey Tucker
314
This bug affects 8 people
Affects Status Importance Assigned to Milestone
samba (CentOS)
Fix Released
Critical
samba (Debian)
Fix Released
Unknown
samba (Fedora)
Fix Released
Critical
samba (Ubuntu)
Fix Released
High
Tyler Hicks
Hardy
Fix Released
High
Tyler Hicks
Lucid
Fix Released
High
Tyler Hicks
Natty
Fix Released
High
Tyler Hicks
Oneiric
Fix Released
High
Tyler Hicks
Precise
Fix Released
High
Tyler Hicks

Bug Description

CVE-2012-1182 was recently made public for a remote, unauthenticated, root code execution flaw in most samba versions 3.0+:

https://www.samba.org/samba/security/CVE-2012-1182

I believe Ubuntu's packages to be vulnerable. As the CVE is already public and patches are in the wild, I am flagging this as a security vulnerability but will un-privatize it shortly.

Revision history for this message
In , Jan (jan-redhat-bugs) wrote :

Multiple heap-based buffer overflow flaws were found in the way the code generated by Perl-based DCE/RPC IDL (PIDL) compiler of the Samba suite performed array memory allocation. Memory for an array having an is_size() attribute has been allocated based on the array length, which was provided by the Network Data Representation (NDR) marshalling code (converting parameters provided to the RPC call by the client to the NDR). On the other hand the loop retrieving array elements for a particular array used variable indicated by the size_is() attribute. A remote attacker could provide a specially-crafted remote procedure call (RPC) parameters, which once processed by the marshalling code of the Samba server would lead to Samba daemon (smbd) crash, or, potentially arbitrary code execution with the privileges of the user running the server.

Revision history for this message
In , Vincent (vincent-redhat-bugs) wrote :

This has been corrected in upstream 3.6.4, 3.5.14, and 3.4.16.

External References:

http://www.samba.org/samba/history/samba-3.6.4.html

Revision history for this message
In , errata-xmlrpc (errata-xmlrpc-redhat-bugs) wrote :

This issue has been addressed in following products:

  Red Hat Enterprise Linux 5.6 EUS - Server Only
  Red Hat Enterprise Linux 5

Via RHSA-2012:0466 https://rhn.redhat.com/errata/RHSA-2012-0466.html

Revision history for this message
In , errata-xmlrpc (errata-xmlrpc-redhat-bugs) wrote :

This issue has been addressed in following products:

  Red Hat Enterprise Linux 5.3 Long Life
  Red Hat Enterprise Linux 5.6 EUS - Server Only
  Red Hat Enterprise Linux 5
  Red Hat Enterprise Linux 6.0 EUS - Server Only
  Red Hat Enterprise Linux 6.1 EUS - Server Only
  Red Hat Enterprise Linux 6

Via RHSA-2012:0465 https://rhn.redhat.com/errata/RHSA-2012-0465.html

Revision history for this message
In , Vincent (vincent-redhat-bugs) wrote :

This is an automatically created tracking bug! It was created to ensure
that one or more security vulnerabilities are fixed in affected Fedora
versions.

For comments that are specific to the vulnerability please use bugs filed
against "Security Response" product referenced in the "Blocks" field.

For more information see:
http://fedoraproject.org/wiki/Security/TrackingBugs

When creating a Bodhi update request, please include this bug ID and the
bug IDs of this bug's parent bugs filed against the "Security Response"
product (the top-level CVE bugs). Please mention the CVE IDs being fixed
in the RPM changelog when available.

Bodhi update submission link:
https://admin.fedoraproject.org/updates/new/?type_=security&bugs=804093

Please note: this issue affects multiple supported versions of Fedora.
Only one tracking bug has been filed; please ensure that it is only closed
when all affected versions are fixed.

[bug automatically created by: add-tracking-bugs]

Revision history for this message
In , Vincent (vincent-redhat-bugs) wrote :

Created samba tracking bugs for this issue

Affects: fedora-all [bug 811392]

Rey Tucker (rtucker)
visibility: private → public
Revision history for this message
Tyler Hicks (tyhicks) wrote :

Thanks, Ryan! We are aware of the issue and we are currently working on an update.

Changed in samba (Ubuntu):
assignee: nobody → Tyler Hicks (tyhicks)
status: New → Confirmed
importance: Undecided → High
Changed in samba (Debian):
status: Unknown → New
Revision history for this message
In , Jan (jan-redhat-bugs) wrote :

*** Bug 811543 has been marked as a duplicate of this bug. ***

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

samba-3.6.4-82.fc17.1 has been submitted as an update for Fedora 17.
https://admin.fedoraproject.org/updates/samba-3.6.4-82.fc17.1

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

samba-3.6.4-82.fc16 has been submitted as an update for Fedora 16.
https://admin.fedoraproject.org/updates/samba-3.6.4-82.fc16

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

samba-3.5.14-73.fc15.1 has been submitted as an update for Fedora 15.
https://admin.fedoraproject.org/updates/samba-3.5.14-73.fc15.1

Revision history for this message
In , Gwyn (gwyn-redhat-bugs) wrote :

Rawhide has been updated, updates have been created for f17, f16 and f15.

Changed in samba (Ubuntu Precise):
milestone: none → ubuntu-12.04
status: Confirmed → In Progress
tags: added: rls-p-tracking
Changed in samba (Ubuntu Lucid):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Tyler Hicks (tyhicks)
Changed in samba (Ubuntu Natty):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Tyler Hicks (tyhicks)
Changed in samba (Ubuntu Oneiric):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Tyler Hicks (tyhicks)
Changed in samba (Ubuntu Hardy):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Tyler Hicks (tyhicks)
Revision history for this message
Tyler Hicks (tyhicks) wrote :

Here is my proposed debdiff for Precise. I'll need a sponsor for this to make it into the release.

I've built a package locally with this debdiff. I sanity checked it using the 'umt compare-log', 'umt compare-bin', and 'umt check' tools. I tested it with the reproducers from ZDI, as well as test-samba.py in the qa-regression-testing project. The reproducers were mitigated with the update and tset-samba.py passed successfully.

Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Hi Tyler,

+1 on the diff, that looks good.

Note that an alternative to shipping the second patch is to update the generated files from the package itself, so the diff isn't massive; this would require adding "make -C source3 samba3-idl" as part of the build step and adding libparse-yapp-perl to the build dependencies.

I should be able to sponsor, though it's well past my EOD, so it might be better if somebody else could.

Revision history for this message
Tyler Hicks (tyhicks) wrote :

Thanks Jelmer! You've probably already noticed, but jdstrand has sponsored it.

I was wondering if we could generate the PIDL generated code at build time, but I decided against it for sake of making cherry-picking from upstream stable branches easy in the future. Upstream has reran the PIDL compiler and committed that as a change, so any new security backports that they do will be based upon the regenerated code. It seems like it would be in our best interest to follow what upstream did. Any thoughts?

Revision history for this message
Tyler Hicks (tyhicks) wrote :

Ok, now I see that the 3.6 upstream branch places the samba3-idl target underneath 'make all', so I assume that they are now relying on the code generation to happen at build time. Can you confirm this, Jelmer?

If that's the case, then we probably do want to follow that convention in our 3.6.x and later packages (currently only found in Precise). The reason is that if we don't do it at build time, but upstream does, one of their patches that we cherry-pick could theoritically need to be ran through PIDL to make proper changes. I _think_ that's the case, but I'm still not quite knowldgeable on the PIDL compiler to know for sure.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "samba_3.6.3-2ubuntu2.debdiff" of this bug report has been identified as being a patch in the form of a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. In the event that this is in fact not a patch you can resolve this situation by removing the tag 'patch' from the bug report and editing the attachment so that it is not flagged as a patch. Additionally, if you are member of the ubuntu-sponsors team please also unsubscribe the team from this bug report.

[This is an automated message performed by a Launchpad user owned by Brian Murray. Please contact him regarding any issues with the action taken in this bug report.]

tags: added: patch
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:3.5.11~dfsg-1ubuntu2.2

---------------
samba (2:3.5.11~dfsg-1ubuntu2.2) oneiric-security; urgency=low

  * SECURITY UPDATE: Unauthenticated remote code execution via
    RPC calls (LP: #978458)
    - debian/patches/CVE-2012-1182-1.patch: Fix PIDL compiler to generate code
      that uses the same value for array allocation and array length checks.
      Based on upstream patch.
    - debian/patches/CVE-2012-1182-2.patch: Regenerate PIDL generated files with
      the patched PIDL compiler
    - CVE-2012-1182
 -- Tyler Hicks <email address hidden> Thu, 12 Apr 2012 05:28:44 -0500

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:3.5.8~dfsg-1ubuntu2.4

---------------
samba (2:3.5.8~dfsg-1ubuntu2.4) natty-security; urgency=low

  * SECURITY UPDATE: Unauthenticated remote code execution via
    RPC calls (LP: #978458)
    - debian/patches/CVE-2012-1182-1.patch: Fix PIDL compiler to generate code
      that uses the same value for array allocation and array length checks.
      Based on upstream patch.
    - debian/patches/CVE-2012-1182-2.patch: Regenerate PIDL generated files with
      the patched PIDL compiler
    - CVE-2012-1182
 -- Tyler Hicks <email address hidden> Thu, 12 Apr 2012 05:28:44 -0500

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:3.4.7~dfsg-1ubuntu3.9

---------------
samba (2:3.4.7~dfsg-1ubuntu3.9) lucid-security; urgency=low

  * SECURITY UPDATE: Unauthenticated remote code execution via
    RPC calls (LP: #978458)
    - debian/patches/CVE-2012-1182-1.patch: Fix PIDL compiler to generate code
      that uses the same value for array allocation and array length checks.
      Based on upstream patch.
    - debian/patches/CVE-2012-1182-2.patch: Regenerate PIDL generated files with
      the patched PIDL compiler
    - CVE-2012-1182
 -- Tyler Hicks <email address hidden> Thu, 12 Apr 2012 05:28:44 -0500

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 3.0.28a-1ubuntu4.18

---------------
samba (3.0.28a-1ubuntu4.18) hardy-security; urgency=low

  [ Steve Beattie ]
  * SECURITY UPDATE: unauthenticated remote code execution via
    RPC calls (LP: #978458)
    - debian/patches/security-CVE-2012-1182.patch: make variable length
      check be consistent with memory allocation size computation.
    - CVE-2012-1182
 -- Tyler Hicks <email address hidden> Thu, 12 Apr 2012 05:28:44 -0500

Changed in samba (Ubuntu Hardy):
status: In Progress → Fix Released
Changed in samba (Ubuntu Lucid):
status: In Progress → Fix Released
Changed in samba (Ubuntu Natty):
status: In Progress → Fix Released
Changed in samba (Ubuntu Oneiric):
status: In Progress → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package samba - 2:3.6.3-2ubuntu2

---------------
samba (2:3.6.3-2ubuntu2) precise-proposed; urgency=low

  * SECURITY UPDATE: Unauthenticated remote code execution via
    RPC calls (LP: #978458)
    - debian/patches/CVE-2012-1182-1.patch: Fix PIDL compiler to generate code
      that uses the same value for array allocation and array length checks.
      Based on upstream patch.
    - debian/patches/CVE-2012-1182-2.patch: Regenerate PIDL generated files
      with the patched PIDL compiler
    - CVE-2012-1182
 -- Tyler Hicks <email address hidden> Thu, 12 Apr 2012 05:28:44 -0500

Changed in samba (Ubuntu Precise):
status: In Progress → Fix Released
Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

Package samba-3.6.4-82.fc17.1:
* should fix your issue,
* was pushed to the Fedora 17 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing samba-3.6.4-82.fc17.1'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2012-5793/samba-3.6.4-82.fc17.1
then log in and leave karma (feedback).

Revision history for this message
In , Huzaifa (huzaifa-redhat-bugs) wrote :

Created samba4 tracking bugs for this issue

Affects: fedora-all [bug 812257]

Revision history for this message
In , errata-xmlrpc (errata-xmlrpc-redhat-bugs) wrote :

This issue has been addressed in following products:

  Red Hat Enterprise Linux 4 Extended Lifecycle Support

Via RHSA-2012:0478 https://rhn.redhat.com/errata/RHSA-2012-0478.html

Changed in samba (Debian):
status: New → Fix Released
Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

samba-3.6.4-82.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

samba-3.6.4-82.fc17.1 has been pushed to the Fedora 17 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

samba-3.5.14-73.fc15.1 has been pushed to the Fedora 15 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Tomas (tomas-redhat-bugs) wrote :

Statement:

This issue did not affect the versions of samba packages as shipped with Red Hat Enterprise Linux 3. The samba packages are also excluded from the Red Hat Enterprise Linux 3 Extended Life Cycle Support coverage:
http://www.redhat.com/rhel/server/extended_lifecycle_support/exclusions/

Revision history for this message
In , Fedora (fedora-redhat-bugs) wrote :

samba4-4.0.0-38.alpha16.fc16 has been pushed to the Fedora 16 stable repository. If problems still persist, please make note of it in this bug report.

Revision history for this message
In , Huzaifa (huzaifa-redhat-bugs) wrote :

Statement:

This issue affects the version of samba4, openchange and evolution-mapi packages as shipped with Red Hat Enterprise Linux 6. A future security update may address this flaw.

Revision history for this message
In , Huzaifa (huzaifa-redhat-bugs) wrote :

This flaw exists in the samba PIDL code, and therefore affects the PIDL compiler shipped within the samba4 package (samba4-pidl). However we do not ship any daemon with the samba4 package, hence the impact of this flaw on samba4 is very limited.

The samba4-pidl compiler is also used to compile code in the openchange and evolution-mapi packages. These contain client side code for exchanging data with MAPI servers. In order to successfully exploit vulnerabilities in these packages, arising out of the above flaw in samba4-pidl, one will need to MITM the connection between these clients and the MAPI servers. Hence the impact on these packages is limited as well.

Revision history for this message
In , errata-xmlrpc (errata-xmlrpc-redhat-bugs) wrote :

This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2013:0506 https://rhn.redhat.com/errata/RHSA-2013-0506.html

Revision history for this message
In , errata-xmlrpc (errata-xmlrpc-redhat-bugs) wrote :

This issue has been addressed in following products:

  Red Hat Enterprise Linux 6

Via RHSA-2013:0515 https://rhn.redhat.com/errata/RHSA-2013-0515.html

Changed in samba (CentOS):
importance: Unknown → Critical
status: Unknown → Fix Released
Changed in samba (Fedora):
importance: Unknown → Critical
status: Unknown → Fix Released
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.