RVM automatically installs gems as...

- AV AC AU C I A
发布: 2025-04-13
修订: 2025-04-13

RVM, by default, hooks `cd` and automatically parses a file named `.versions.conf` in the directory being changed to. This file can provide the names of arbitrary gems, via `ruby-gem-install` entries, which will be automatically passed to `gem install` upon `cd` into the directory. The code responsible, as of a vulnerable commit, is available at <https://github.com/rvm/rvm/blob/b04c0158d/scripts/functions/rvmrc_project#L100>. This behaviour can be used to achieve immediate installation of an arbitrary Ruby gem. This can be used to gain immediate Ruby code execution if that gem defines a `post_install` hook. Furthermore, the gem can be located in `$PWD`, making this a fully self-contained attack. Thanks to <http://stackoverflow.com/a/33739910> for detailing the `post_install` hook trick. It is critical that `.versions.conf` specifies a version of Ruby that satisfies RVM and will allow the user to successfully install gems. This may be a version of Ruby that the user has installed...

0%
暂无可用Exp或PoC
当前有0条受影响产品信息