Summary
Unauthenticated nested page API leaks restricted & unpublished content
- Location:
app/controllers/alchemy/api/pages_controller.rb:28(Api::PagesController#nested) - Affected version: Alchemy CMS 8.3.0.dev (Rails 8.1.3)
Description
The unauthenticated GET /api/pages/nested endpoint returns the full page tree to any anonymous caller, including restricted (member-only) pages and unpublished/draft pages that should be hidden.
Appending ?elements=true additionally dumps the element/ingredient content of restricted pages, fully bypassing the access control the sibling show and index actions enforce.
Root cause
Api::PagesController#nested calls no authorize! and applies no published/restricted scoping, unlike show (authorize! :show) and index (accessible_by(current_ability, :index)).PageTreePreloader loads page.self_and_descendants unfiltered, and PageTreeSerializer emits every page's metadata (and, with elements, public_version.elements) with no ability check.
Evidence
An unauthenticated GET /api/pages/nested returns HTTP 200 with the restricted page ("restricted":true) and an unpublished draft ("public":false); ?elements=true leaks its content (e.g. TOPSECRET_RESTRICTED_BODY_proof123).
The same guest hitting GET /api/pages/3 (show) gets HTTP 403 {"error":"Not authorized"}, proving nested returns what show correctly denies.
Reproduction
# 1) Metadata leak (guest, no auth)
curl -s http://localhost:3000/api/pages/nested | python3 -m json.tool | grep -E '"name"|"restricted"|"public"'
# 2) Content leak of restricted page
curl -s "http://localhost:3000/api/pages/nested?elements=true" | grep -oE 'TOPSECRET_RESTRICTED_BODY_[A-Za-z0-9]+|RESTRICTED_RICHTEXT_[A-Za-z0-9]+'
# 3) Contrast, show denies the same guest
curl -s -o /dev/null -w "show /api/pages/3 -> HTTP %{http_code}\n" http://localhost:3000/api/pages/3
Impact
The application does not perform an authorization check before performing a sensitive operation. Typical impact: unauthorized access to restricted functionality or data.
GHSA-MQQ5-J7W8-2HGH has a CVSS score of 7.5 (High). The vector is network-reachable, no 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 (8.2.6, 8.1.14, 8.0.15, 7.4.15); upgrading removes the vulnerable code path.
Affected versions
Security releases
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. Kodem's runtime-powered SCA identifies whether this CVE is reachable in your applications.
Remediation advice
def nested
@page = Page.find_by(id: params[:page_id]) || Language.current_root_page
authorize! :show, @page
preloaded_page = PageTreePreloader.new(page: @page, user: current_alchemy_user, ability: current_ability).call
render json: PageTreeSerializer.new(preloaded_page, ability: current_ability,
user: current_alchemy_user, elements: params[:elements])
end
Additionally scope PageTreePreloader's self_and_descendants via accessible_by(current_ability) and gate element emission in PageTreeSerializer#page_elements behind opts[:ability].can?(:show, page).
Frequently Asked Questions
- What is GHSA-MQQ5-J7W8-2HGH? GHSA-MQQ5-J7W8-2HGH is a high-severity missing authorization vulnerability in alchemy_cms (rubygems), affecting versions >= 8.2.0, <= 8.2.5. It is fixed in 8.2.6, 8.1.14, 8.0.15, 7.4.15. The application does not perform an authorization check before performing a sensitive operation.
- How severe is GHSA-MQQ5-J7W8-2HGH? GHSA-MQQ5-J7W8-2HGH has a CVSS score of 7.5 (High). 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 alchemy_cms are affected by GHSA-MQQ5-J7W8-2HGH? alchemy_cms (rubygems) versions >= 8.2.0, <= 8.2.5 is affected.
- Is there a fix for GHSA-MQQ5-J7W8-2HGH? Yes. GHSA-MQQ5-J7W8-2HGH is fixed in 8.2.6, 8.1.14, 8.0.15, 7.4.15. Upgrade to this version or later.
- Is GHSA-MQQ5-J7W8-2HGH exploitable, and should I be worried? Whether GHSA-MQQ5-J7W8-2HGH 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 GHSA-MQQ5-J7W8-2HGH 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 GHSA-MQQ5-J7W8-2HGH?
- Upgrade
alchemy_cmsto 8.2.6 or later - Upgrade
alchemy_cmsto 8.1.14 or later - Upgrade
alchemy_cmsto 8.0.15 or later - Upgrade
alchemy_cmsto 7.4.15 or later
- Upgrade