|
| 1 | +--- |
| 2 | +gem: view_component |
| 3 | +ghsa: 8qw7-6phv-7q6p |
| 4 | +url: https://github.com/ViewComponent/view_component/security/advisories/GHSA-8qw7-6phv-7q6p |
| 5 | +title: ViewComponent - Incomplete fix for CVE-2026-54497 — slot and |
| 6 | + with_content state still leak across reused component instances |
| 7 | +date: 2026-08-28 |
| 8 | +description: | |
| 9 | + ## Summary |
| 10 | +
|
| 11 | + CVE-2026-54497 was fixed by having render_in call __vc_reset_render_state!, |
| 12 | + which clears exactly three ivars (@__vc_controller, @__vc_helpers, |
| 13 | + @__vc_request) on every render so a reused ViewComponent::Base instance |
| 14 | + can't leak the previous request's controller/helpers/request. The |
| 15 | + fix's own comment admits it deliberately leaves two other pieces of |
| 16 | + render-scoped state untouched: @__vc_set_slots (populated by with_<slot> |
| 17 | + setters) and @__vc_content_set_by_with_content (populated by with_content), |
| 18 | + reasoning that these are "populated by callers before render_in runs." |
| 19 | + That reasoning only holds for the intended one-instance-per-render |
| 20 | + usage pattern — it breaks down in exactly the reuse/aliasing scenario |
| 21 | + the CVE fix was written for, because these two ivars hold the actual |
| 22 | + content/data being rendered (often user- or session-specific), not |
| 23 | + just framework plumbing. |
| 24 | +
|
| 25 | + ## IMPACT |
| 26 | +
|
| 27 | + Any application that follows the common ViewComponent idiom of |
| 28 | + pre-populating a component with request/user data via |
| 29 | + with_content/with_<slot> and then ends up reusing that same instance |
| 30 | + across two different requests/users — due to caching, pooling, |
| 31 | + memoization, or the aliasing pattern the vendor's own fix commit |
| 32 | + explicitly anticipated — leaks the first user's data to the second, |
| 33 | + despite the CVE-2026-54497 fix having run. |
| 34 | +
|
| 35 | + ## CREDIT |
| 36 | +
|
| 37 | + Yazan Balawneh, Cystack.ps |
| 38 | +cvss_v3: 6.8 |
| 39 | +patched_versions: |
| 40 | + - ">= 4.14.0" |
| 41 | +related: |
| 42 | + url: |
| 43 | + - https://github.com/ViewComponent/view_component/blob/main/docs/CHANGELOG.md#4140 |
| 44 | + - https://github.com/ViewComponent/view_component/compare/v4.13.0...v4.14.0 |
| 45 | + - https://github.com/ViewComponent/view_component/pull/2691 |
| 46 | + - https://github.com/ViewComponent/view_component/security/advisories/GHSA-8qw7-6phv-7q6p |
| 47 | +notes: | |
| 48 | + - No CVE in GHSA URL. |
| 49 | + - cvss_v3 from GHSA URL. |
| 50 | + - Note that gem name in view_component and repo name is ViewComponent. |
| 51 | + - GHSA affected range is "<= 4.12.0", but 4.13.0 is also vulnerable; |
| 52 | + the fix shipped in 4.14.0 per the view_component CHANGELOG. |
0 commit comments