DSA-065-1 samba -- remote file append/creation

Related Vulnerabilities: CVE-2001-1162  

Michal Zalewski discovered that Samba does not properly validate NetBIOS names from remote machines. By itself that is not a problem, except if Samba is configured to write log-files to a file that includes the NetBIOS name of the remote side by using the `%m' macro in the `log file' command. In that case an attacker could use a NetBIOS name like '../tmp/evil'. If the log-file was set to "/var/log/samba/%s" Samba would then write to /var/tmp/evil. Since the NetBIOS name is limited to 15 characters and the `log file' command could have an extension to the filename the results of this are limited. However if the attacker is also able to create symbolic links on the Samba server they could trick Samba into appending any data they want to all files on the filesystem which Samba can write to. The Debian GNU/Linux packaged version of Samba has a safe configuration and is not vulnerable. As temporary workaround for systems that are vulnerable change all occurrences of the `%m' macro in smb.conf to `%l' and restart Samba. This has been fixed in version 2.0.7-3.4, and we recommend that you upgrade your Samba package immediately.

Debian Security Advisory

DSA-065-1 samba -- remote file append/creation

Date Reported:
23 Jun 2001
Affected Packages:
samba
Vulnerable:
Yes
Security database references:
In the Bugtraq database (at SecurityFocus): BugTraq ID 2927.
In Mitre's CVE dictionary: CVE-2001-1162.
More information:
Michal Zalewski discovered that Samba does not properly validate NetBIOS names from remote machines.

By itself that is not a problem, except if Samba is configured to write log-files to a file that includes the NetBIOS name of the remote side by using the `%m' macro in the `log file' command. In that case an attacker could use a NetBIOS name like '../tmp/evil'. If the log-file was set to "/var/log/samba/%s" Samba would then write to /var/tmp/evil.

Since the NetBIOS name is limited to 15 characters and the `log file' command could have an extension to the filename the results of this are limited. However if the attacker is also able to create symbolic links on the Samba server they could trick Samba into appending any data they want to all files on the filesystem which Samba can write to.

The Debian GNU/Linux packaged version of Samba has a safe configuration and is not vulnerable.

As temporary workaround for systems that are vulnerable change all occurrences of the `%m' macro in smb.conf to `%l' and restart Samba.

This has been fixed in version 2.0.7-3.4, and we recommend that you upgrade your Samba package immediately.

Fixed in:

Debian GNU/Linux 2.2 (potato)

Source:
http://security.debian.org/dists/stable/updates/main/source/samba_2.0.7-3.4.diff.gz
http://security.debian.org/dists/stable/updates/main/source/samba_2.0.7-3.4.dsc
http://security.debian.org/dists/stable/updates/main/source/samba_2.0.7.orig.tar.gz
Architecture-independent component:
http://security.debian.org/dists/stable/updates/main/binary-all/samba-doc_2.0.7-3.4_all.deb
Alpha:
http://security.debian.org/dists/stable/updates/main/binary-alpha/samba-common_2.0.7-3.4_alpha.deb
http://security.debian.org/dists/stable/updates/main/binary-alpha/samba_2.0.7-3.4_alpha.deb
http://security.debian.org/dists/stable/updates/main/binary-alpha/smbclient_2.0.7-3.4_alpha.deb
http://security.debian.org/dists/stable/updates/main/binary-alpha/smbfs_2.0.7-3.4_alpha.deb
http://security.debian.org/dists/stable/updates/main/binary-alpha/swat_2.0.7-3.4_alpha.deb
ARM:
http://security.debian.org/dists/stable/updates/main/binary-arm/samba-common_2.0.7-3.4_arm.deb
http://security.debian.org/dists/stable/updates/main/binary-arm/samba_2.0.7-3.4_arm.deb
http://security.debian.org/dists/stable/updates/main/binary-arm/smbclient_2.0.7-3.4_arm.deb
http://security.debian.org/dists/stable/updates/main/binary-arm/smbfs_2.0.7-3.4_arm.deb
http://security.debian.org/dists/stable/updates/main/binary-arm/swat_2.0.7-3.4_arm.deb
Intel IA-32:
http://security.debian.org/dists/stable/updates/main/binary-i386/samba-common_2.0.7-3.4_i386.deb
http://security.debian.org/dists/stable/updates/main/binary-i386/samba_2.0.7-3.4_i386.deb
http://security.debian.org/dists/stable/updates/main/binary-i386/smbclient_2.0.7-3.4_i386.deb
http://security.debian.org/dists/stable/updates/main/binary-i386/smbfs_2.0.7-3.4_i386.deb
http://security.debian.org/dists/stable/updates/main/binary-i386/swat_2.0.7-3.4_i386.deb
Motorola 680x0:
http://security.debian.org/dists/stable/updates/main/binary-m68k/samba-common_2.0.7-3.4_m68k.deb
http://security.debian.org/dists/stable/updates/main/binary-m68k/samba_2.0.7-3.4_m68k.deb
http://security.debian.org/dists/stable/updates/main/binary-m68k/smbclient_2.0.7-3.4_m68k.deb
http://security.debian.org/dists/stable/updates/main/binary-m68k/smbfs_2.0.7-3.4_m68k.deb
http://security.debian.org/dists/stable/updates/main/binary-m68k/swat_2.0.7-3.4_m68k.deb
PowerPC:
http://security.debian.org/dists/stable/updates/main/binary-powerpc/samba-common_2.0.7-3.4_powerpc.deb
http://security.debian.org/dists/stable/updates/main/binary-powerpc/samba_2.0.7-3.4_powerpc.deb
http://security.debian.org/dists/stable/updates/main/binary-powerpc/smbclient_2.0.7-3.4_powerpc.deb
http://security.debian.org/dists/stable/updates/main/binary-powerpc/smbfs_2.0.7-3.4_powerpc.deb
http://security.debian.org/dists/stable/updates/main/binary-powerpc/swat_2.0.7-3.4_powerpc.deb
Sun Sparc:
http://security.debian.org/dists/stable/updates/main/binary-sparc/samba-common_2.0.7-3.4_sparc.deb
http://security.debian.org/dists/stable/updates/main/binary-sparc/samba_2.0.7-3.4_sparc.deb
http://security.debian.org/dists/stable/updates/main/binary-sparc/smbclient_2.0.7-3.4_sparc.deb
http://security.debian.org/dists/stable/updates/main/binary-sparc/smbfs_2.0.7-3.4_sparc.deb
http://security.debian.org/dists/stable/updates/main/binary-sparc/swat_2.0.7-3.4_sparc.deb

MD5 checksums of the listed files are available in the original advisory.