CyberSecBulletin
CVE-2024-28121NVD status: Analyzed

stimulus_reflex: Use of Externally-Controlled Input to Select Classes or Code

CVE-2024-28121 is a high-severity use of externally-controlled input to select classes or code vulnerability in stimulus_reflex from Stimulusreflex, with a CVSS 3.1 base score of 8.8 out of 10. It can be exploited remotely over the network by an attacker with a low-privileged account, without any action from a user. The record lists versions 3.4.2, 3.5.0.rc4 as the first without the flaw, so updating stimulus_reflex to one of those releases or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 1.55% chance of exploitation within 30 days, higher than 76% of scored CVEs.

Next patch cycle

High severity with no evidence of exploitation so far.

What to do

  1. Update stimulus_reflex to 3.4.2 or 3.5.0.rc4, whichever matches your release line, or a later version.
  2. Update Stimulusrelfex to 3.4.2 or a later version.
  3. Read the advisory on github.com for workarounds and exact fixed builds.

Affected products and versions

VendorProductAffected versionsFixed in
Stimulusreflexstimulus_reflex>= 3.5.0.rc1, < 3.5.0.rc4; < 3.4.2; before 3.4.2; 3.5.0.rc1 up to, but not including, 3.5.0.rc43.4.2, 3.5.0.rc4
StimulusreflexStimulusrelfexbefore 3.4.2; 3.5.03.4.2

Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.

How the severity score breaks down

Attack vector
NetworkCan be exploited remotely over a network, including the internet.
Attack complexity
LowNo special conditions are needed; the attack works reliably.
Privileges required
LowA basic user account is enough.
User interaction
NoneNo action by a victim is required.
Scope
UnchangedImpact stays within the vulnerable component.
Confidentiality
HighAll data handled by the component can be read.
Integrity
HighData or code can be modified at will.
Availability
HighThe component can be taken down completely.

Vector: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H. Scored by CNA (github.com).

Official 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.

Source: the CVE record as published by its numbering authority, via NVD and CVE.org.

The underlying weakness: Use of Externally-Controlled Input to Select Classes or Code

The product uses external input with reflection to select which classes or code to use, but it does not sufficiently prevent the input from selecting improper classes or code.

How developers prevent this class of flaw

  • Refactor your code to avoid using reflection.
  • Do not use user-controlled inputs to select and load classes or code.
  • Apply strict input validation by using allowlists or indirect selection to ensure that the user is only selecting allowable classes or code.

More Use of Externally-Controlled Input to Select Classes or Code vulnerabilities (CWE-470)

Timeline

  1. CVE record published.
  2. CISA published its SSVC assessment (exploitation: none, automatable: no, technical impact: total).
  3. Record last changed materially (score, affected products, status or references).

References

Technical write-ups (may include proof of concept)

Recent Use of Externally-Controlled Input to Select Classes or Code vulnerabilities

Spotted an error? Tell us.