FileUtils is vulnerable to symlink race attacks
Posted by Urabe Shyouhei on 18 Feb 2011
A symlink race condition vulnerability was found in FileUtils.remove_entry_secure. The vulnerability allows local users to delete arbitrary files and directories.
Affected versions
- Ruby 1.8.6 patchlevel 420 and all prior versions
- Ruby 1.8.7 patchlevel 330 and all prior versions
- Development versions of Ruby 1.8 (1.8.8dev)
- Ruby 1.9.1 patchlevel 430 and all prior versions
- Ruby 1.9.2 patchlevel 136 and all prior versions
- Development versions of Ruby 1.9 (1.9.3dev)
Solutions
We have fixed this situation. All affected users are encouraged to upgrade their ruby installation.
But please also note, that symlink race attacks are unavoidable when any of upper directories from where you want to delete are owned by someone you cannot trust. So if you want to be secure, you must ensure that ALL parent directories cannot be moved by other untrusted users. For example, parent directories should not be owned by untrusted users, and should not be world writable except when the sticky bit set.
Updates
- Fixed typo. (vulnerabile -> vulnerable)
- 1.8.7-334 was released to fix this issue. 1.8.7 users are encouraged to upgrade.
- 1.9.1-p431 was released to fix this issue. 1.9.1 users are encouraged to upgrade.
- 1.9.2-p180 was released to fix this issue. 1.9.2 users are encouraged to upgrade.
- Fixed affected versions for 1.9 series.
Recent News
Ruby 4.0.4 Released
Ruby 4.0.4 has been released.
Posted by k0kubun on 11 May 2026
Ruby 4.0.3 Released
Ruby 4.0.3 has been released.
Posted by k0kubun on 21 Apr 2026
Ruby 3.2.11 Released
Ruby 3.2.11 has been released. This release includes an update to the zlib gem addressing CVE-2026-27820.
Posted by hsbt on 27 Mar 2026
Ruby 3.3.11 Released
Ruby 3.3.11 has been released. This release includes an update to the zlib gem addressing CVE-2026-27820, along with some bug fixes.
Posted by hsbt on 26 Mar 2026