|
| 1 | +--- |
| 2 | +layout: advisory |
| 3 | +title: 'CVE-2024-28181 (turbo_boost-commands): TurboBoost Commands vulnerable to arbitrary |
| 4 | + method invocation' |
| 5 | +comments: false |
| 6 | +categories: |
| 7 | +- turbo_boost-commands |
| 8 | +advisory: |
| 9 | + gem: turbo_boost-commands |
| 10 | + cve: 2024-28181 |
| 11 | + ghsa: mp76-7w5v-pr75 |
| 12 | + url: https://github.com/hopsoft/turbo_boost-commands/security/advisories/GHSA-mp76-7w5v-pr75 |
| 13 | + title: TurboBoost Commands vulnerable to arbitrary method invocation |
| 14 | + date: 2024-03-15 |
| 15 | + description: | |
| 16 | + ### Impact |
| 17 | +
|
| 18 | + TurboBoost Commands has existing protections in place to |
| 19 | + guarantee that only public methods on Command classes can be invoked; however, the |
| 20 | + existing checks aren't as robust as they should be. It's possible for a sophisticated |
| 21 | + attacker to invoke more methods than should be permitted depending on the the strictness |
| 22 | + of authorization checks that individual applications enforce. Being able to call |
| 23 | + some of these methods can have security implications. |
| 24 | +
|
| 25 | + #### Details |
| 26 | +
|
| 27 | + Commands verify that the class must be a `Command` and that the method requested is |
| 28 | + defined as a public method; however, this isn't robust enough to guard against all |
| 29 | + unwanted code execution. The library should more strictly enforce which methods are |
| 30 | + considered safe before allowing them to be executed. |
| 31 | +
|
| 32 | + ### Patches |
| 33 | +
|
| 34 | + Patched in the following versions. |
| 35 | + - 0.1.3 |
| 36 | + - [NPM Package](https://www.npmjs.com/package/@turbo-boost/commands/v/0.1.3) |
| 37 | + - [Ruby GEM](https://rubygems.org/gems/turbo_boost-commands/versions/0.1.3) |
| 38 | + - 0.2.2 |
| 39 | + - [NPM Package](https://www.npmjs.com/package/@turbo-boost/commands/v/0.2.2) |
| 40 | + - [Ruby GEM](https://rubygems.org/gems/turbo_boost-commands/versions/0.2.2) |
| 41 | +
|
| 42 | + ### Workarounds |
| 43 | +
|
| 44 | + You can add this guard to mitigate the issue if running an unpatched |
| 45 | + version of the library. |
| 46 | +
|
| 47 | + ```ruby |
| 48 | + class ApplicationCommand < TurboBoost::Commands::Command |
| 49 | + before_command do |
| 50 | + method_name = params[:name].include?(\"#\") ? params[:name].split(\"#\").last : :perform |
| 51 | + ancestors = self.class.ancestors[0..self.class.ancestors.index(TurboBoost::Commands::Command) - 1] |
| 52 | + allowed = ancestors.any? { |a| a.public_instance_methods(false).any? method_name.to_sym } |
| 53 | + throw :abort unless allowed # ← blocks invocation |
| 54 | + # raise \"Invalid Command\" unless allowed # ← blocks invocation |
| 55 | + end |
| 56 | + end |
| 57 | + ``` |
| 58 | + cvss_v3: 8.1 |
| 59 | + patched_versions: |
| 60 | + - "~> 0.1.3" |
| 61 | + - ">= 0.2.2" |
| 62 | + related: |
| 63 | + url: |
| 64 | + - https://nvd.nist.gov/vuln/detail/CVE-2024-28181 |
| 65 | + - https://github.com/hopsoft/turbo_boost-commands/security/advisories/GHSA-mp76-7w5v-pr75 |
| 66 | + - https://github.com/hopsoft/turbo_boost-commands/commit/337cda7d9222f1f449905454a7374222017a7477 |
| 67 | + - https://github.com/hopsoft/turbo_boost-commands/commit/88af4fc0ac39cc1799d16c49fab52f6dfbcec9ba |
| 68 | + - https://github.com/advisories/GHSA-mp76-7w5v-pr75 |
| 69 | +--- |
0 commit comments