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

Recent News

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

More News...