6.5
Medium
view_component

CVE-2026-44836

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.

Key facts
CVSS score
6.5
Medium
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
view_component
Fixed in
4.9.0
Disclosed
2026

Summary

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.

Impact

Severity and exposure

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.

Affected versions

rubygems

  • view_component (>= 3.0.0, < 4.9.0)

Security releases

  • view_component → 4.9.0 (rubygems)
Kodem intelligence

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

Remediation advice

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.

Frequently asked questions about CVE-2026-44836

What is CVE-2026-44836?

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.

How severe is CVE-2026-44836?

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.

Which versions of view_component are affected by CVE-2026-44836?

view_component (rubygems) versions >= 3.0.0, < 4.9.0 is affected.

Is there a fix for CVE-2026-44836?

Yes. CVE-2026-44836 is fixed in 4.9.0. Upgrade to this version or later.

Is CVE-2026-44836 exploitable, and should I be worried?

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

What actually determines whether CVE-2026-44836 is exploitable, and how bad it is?

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.

How do I fix CVE-2026-44836?

Upgrade view_component to 4.9.0 or later.

Stop the waste.
Protect your environment with Kodem.