CVE-2026-44836 is a medium-severity security vulnerability in view_component (rubygems), affecting versions >= 3.0.0, < 4.9.0. It is fixed in 4.9.0.
Summary The preview route derives an example name from the URL and calls it with publicsend. The code does not verify that the requested method is one of the preview examples explicitly defined by the preview class. As a result, inherited public methods on ViewComponent::Preview are route-reachable. The most important one is renderwithtemplate, which accepts template: and locals:. Those values can come from request params and are later passed to Rails as render template:. If previews are exposed, an attacker can render internal Rails templates that are not otherwise routable. Severity: High if preview routes are externally reachable; Medium otherwise. Affected files: lib/viewcomponent/preview.rb app/controllers/concerns/viewcomponent/previewactions.rb app/views/viewcomponents/preview.html.erb Relevant Code app/controllers/concerns/viewcomponent/previewactions.rb: lib/viewcomponent/preview.rb: app/views/viewcomponents/preview.html.erb: The UI only lists direct preview methods via: But renderargs does not enforce that list before dispatching. Exploit Flow Example request: Flow: mycomponent resolves to a valid preview. File.basename(params[:path]) returns renderwithtemplate. renderargs calls inherited ViewComponent::Preview#renderwithtemplate. Request params provide template: "internal/secret" and locals: {...}. The preview view renders internal/secret with attacker-controlled locals. Impact depends on what internal templates render. In the worst case this can expose secrets, config, debug data, admin-only partials, or request/session-derived values. PoC Test This checkout already contains a PoC at: test/sandbox/test/securitypreviewtemplatepoctest.rb test/sandbox/app/views/internal/secret.html.erb The test proves that /internal/secret is not directly routable, but can still be rendered through the preview endpoint by invoking inherited renderwithtemplate. If reproducing manually, run: Equivalent standalone test: Fixture template: Suggested Fix Only dispatch explicitly declared preview examples: Add a regression test that /rails/viewcomponents/mycomponent/renderwithtemplate fails unless renderwithtemplate is explicitly defined as a preview example on that class.
CVE-2026-44836 has a CVSS score of 6.5 (Medium). The vector is network-reachable, low privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.
A fixed version is available (4.9.0). Upgrading removes the vulnerable code path.
rubygems
view_component (>= 3.0.0, < 4.9.0)view_component → 4.9.0 (rubygems)Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.
Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.
Kodem's runtime-powered SCA identifies whether CVE-2026-44836 is reachable in your applications. Explore open-source security for your team.
See if CVE-2026-44836 is reachable in your applications. Get a demo
Upgrade view_component to 4.9.0 or later to resolve this vulnerability.
Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.
CVE-2026-44836 is a medium-severity security vulnerability in view_component (rubygems), affecting versions >= 3.0.0, < 4.9.0. It is fixed in 4.9.0.
CVE-2026-44836 has a CVSS score of 6.5 (Medium). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.
view_component (rubygems) versions >= 3.0.0, < 4.9.0 is affected.
Yes. CVE-2026-44836 is fixed in 4.9.0. Upgrade to this version or later.
Whether CVE-2026-44836 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo
Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.
Upgrade view_component to 4.9.0 or later.