Vulnerability Note VU#268336

Samba command injection vulnerability

Original Release date: 14 May 2007 | Last revised: 21 Jul 2008

Overview

Samba fails to properly filter input to /bin/sh. This vulnerability may allow a remote, authenticated attacker to execute arbitrary code on a Samba server.

Description

Samba provides file and print services for Microsoft Windows, Unix, Linux, and OS X clients. Samba can also act as a Primary Domain Controller (PDC) or as a Domain Member. Samba runs on most Unix-like systems.

Samba versions prior to 3.0.24 pass unchecked user input from RPC messages to /bin/sh when calling externals scripts that are listed in the Samba configuration file. An attacker may be able to exploit this vulnerability by sending specially crafted RPC messages to a vulnerable server.

This vulnerability occurred as a result of failing to comply with recommndation STR02-C of the CERT C Programming Language Secure Coding Standard.

Impact

A remote, unauthenticated attacker may be able to execute arbitrary commands.

Solution

Apply a patch or upgrade
These vulnerabilities are addressed in Samba version 3.0.25. In addition, patches are available to address this vulnerability in Samba version 3.0.24. Refer to the Samba Security Releases website for more information.

Do not load external shell scripts


From the CVE-2007-2447 entry on the Samba security page:

    This defect may be alleviated by removing all defined external script invocations (username map script, add printer command, etc...) from smb.conf.

Restrict access

Limiting access to the Samba server to trusted hosts may mitigate this vulnerability.

Systems Affected

VendorStatusDate NotifiedDate Updated
Apple Computer, Inc.Vulnerable14 May 200721 Jul 2008
Conectiva Inc.Unknown14 May 200721 Jul 2008
Cray Inc.Unknown14 May 200721 Jul 2008
Debian GNU/LinuxVulnerable14 May 200721 Jul 2008
EMC, Inc. (formerly Data General Corporation)Unknown14 May 200721 Jul 2008
Engarde Secure LinuxUnknown14 May 200721 Jul 2008
F5 Networks, Inc.Unknown14 May 200721 Jul 2008
Fedora ProjectUnknown14 May 200721 Jul 2008
FreeBSD, Inc.Unknown14 May 200721 Jul 2008
FujitsuUnknown14 May 200721 Jul 2008
Gentoo LinuxVulnerable14 May 200721 Jul 2008
Hewlett-Packard CompanyUnknown14 May 200721 Jul 2008
HitachiUnknown14 May 200721 Jul 2008
IBM CorporationUnknown14 May 200721 Jul 2008
IBM Corporation (zseries)Unknown14 May 200721 Jul 2008
View More »

CVSS Metrics (Learn More)

Group Score Vector
Base N/A N/A
Temporal N/A N/A
Environmental N/A N/A

References

Credit

Thanks to Joshua J. Drake, iDefense Labs, and the Samba team for information that was used in this report.

This document was written by Ryan Giobbi.

Other Information

  • CVE IDs: CVE-2007-2447
  • Date Public: 14 May 2007
  • Date First Published: 14 May 2007
  • Date Last Updated: 21 Jul 2008
  • Severity Metric: 7.44
  • Document Revision: 41

Feedback

If you have feedback, comments, or additional information about this vulnerability, please send us email.

This product is provided subject to the Notification as indicated here: http://www.us-cert.gov/legal.html#notify

Document Feedback

Was this document helpful?   Yes   |   Somewhat   |  No