RVM automatically does "bundle...

- 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. The intention seems to be that, if the user's `${rvm_autoinstall_bundler_flag}` setting is enabled, then `.versions.conf` can specify a Gemfile that will automatically be fed to `bundle install`. Due to an erroneous conditional that uses `||` (OR) instead of `&&` (AND), `.versions.conf` can provide the name of an arbitrary Gemfile that will automatically be fed to `bundle install` regardless of the state of `${rvm_autoinstall_bundler_flag}`. The code responsible, as of a vulnerable commit, is available at <https://github.com/rvm/rvm/blob/b04c0158dbadc9a999a2af4f39bc008976b9ebf1/scripts/functions/rvmrc_project#L102-L113>. This behaviour can be used to achieve immediate ruby code execution upon `cd` into a malicious directory since Gemfiles are interpreted using Ruby <https://github.com/bundler/bundler/issues/5178> ### POC ```text rvm@e6aeaf6d79ec:~$ mkdir poc...

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