REDHAT-BUG-2541804: XSS
Hugo is a static site generator. In versions from v0.56.0 through v0.165.x, content files mapped to the text/org media type are rendered without escaping raw HTML: Org export blocks and @@html:...@@ snippets pass HTML through unescaped, resulting in cross-site scripting (XSS) in the generated site. An attacker who can supply or influence a content file under /content or the output of a content adapter can inject scripts that execute in the browsers of visitors to the affected pages. Only pages whose source file or content-adapter output declares the text/org media type are affected, and sites that fully trust all content sources are not impacted. Version v0.166.0 fixes the issue by introducing a security.allowContent allowlist that denies text/org by default; sites that intentionally author Org Mode content can opt back in with [security] allowContent = ['.'].
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade to a fixed release to a version that resolves this vulnerability.
Fixed in v0.166.0
Event History
Frequently Asked Questions
Which sites are realistically exposed to this issue?
Sites are affected only when a page source file or content-adapter output declares the text/org media type. Sites that fully trust every source able to provide content are not impacted.
What does an attacker need to exploit the vulnerability?
An attacker needs the ability to supply or influence a content file under /content, or to influence content produced by a content adapter. They can then use Org export blocks or @@html:...@@ snippets to inject HTML and script into generated pages.
Are default settings affected after upgrading to the fixed release?
In v0.166.0, text/org is denied by default through the security.allowContent allowlist. Sites that intentionally use Org Mode content must explicitly opt back in, for example with [security] allowContent = ['.*'].
How can I determine whether my site may already be affected?
Review content under /content and all content-adapter outputs for files or generated content declaring the text/org media type. For those pages, check for Org export blocks or @@html:...@@ snippets containing raw HTML or script supplied by untrusted or insufficiently trusted sources.