FreeBSD-SA-06:16.smbfs "smbfs chroot escape"

The FreeBSD Project よりセキュリティ勧告が出ました。私の認識を以下にまとめます。

  • 危険度

セキュリティ勧告は ftp://ftp.freebsd.org/pub/FreeBSD/CERT/advisories/FreeBSD-SA-06:16.smbfs.asc にあります。
以下は上記のセキュリティ勧告の一部とその翻訳です。ただし品質は保証致しません。

I. 背景 - Background

smbfs is a network file-system used to access file servers using the SMB/CIFS protocol. chroot(2) is system call designed to limit a process's access to a particular subset of a file-system.
smbfsはSMB/CIFSプロトコルを使用してファイルサーバにアクセスするネットワークファイルシステムです。chroot(2)はプロセスがファイルシステムの特定の一部に制限するように設計されたシステムコールです。

II. 問題の詳細 - Problem Description

smbfs does not properly sanitize paths containing a backslash character; in particular the directory name '..\' is interpreted as the parent directory by the SMB/CIFS server, but smbfs handles it in the same manner as any other directory.
smbfsはバックスラッシュ文字を含むパスに適切なサニタイズを行なっていません;特に「..\」というディレクトリ名はSMB/CIFSサーバの親ディレクトリのように解釈しますが、smbfsはあらゆる他のディレクトリを扱います。

III. 影響範囲 - Impact

When inside a chroot environment which resides on a smbfs mounted file-system it is possible for an attacker to escape out of this chroot to any other directory on the smbfs mounted file-system.
smbfsをマウントしたファイルシステムが存在するchroot環境において、smbfsがマウントされたファイルシステムのどのディレクトリも、攻撃者はこのchroot以外へ逃れる事が可能となります。

IV. 回避方法 - Workaround

Mount the smbfs file-systems which need to be used with chroot on top, in a way so the chroot directory is exactly on the mount point and not a sub directory.
chrootを使用する必要のあるsmbfsファイルシステムを、chrootディレクトリがちょうどマウントポイントでありサブディレクトリではないように、トップでマウントします。