RubySec

Providing security resources for the Ruby community

GHSA-pm72-wq9v-wvfh (alchemy_cms): Stored XSS in PictureView figcaption via html_safe on User Caption

Stored XSS in PictureView figcaption via html_safe on User Caption

Published: July 22, 2026

SECURITY IDENTIFIERS

GEM

alchemy_cms

SEVERITY

CVSS v3.x: 5.4 (Medium)

PATCHED VERSIONS

~> 8.0.16 ~> 8.1.15 ~> 8.2.9 >= 8.3.5

DESCRIPTION

Summary

Alchemy::Ingredients::PictureView#caption calls ingredient.caption.html_safe and passes the result to content_tag(:figcaption, …). The caption value is user-supplied (set via the ingredients_attributes[caption] parameter in the element save API) and is stored in a JSON data column with no sanitization. Because .html_safe is called before content_tag, Rails' automatic HTML escaping is suppressed and the raw user string is emitted into the published page, executing in every visitor's browser.

RELATED