nday
GHSA-4whp-jx7j-xvrm

Hugo highlight wrapperClass option allows stored cross-site scripting

公開当日に修正版が確認されています。修正済みバージョンは github.com/gohugoio/hugo 0.170.0 です。4 つの PoC ソースのいずれにも未掲載です。CISA KEV には現時点で未掲載です。

tags weakness typeXSS accesslocalno authentication required ecosystemGo
why these tags

nday derives these tags by fixed rules from the facts below; NVD, the CNA and other sources do not assign them. Vocabulary and rules: ~/tags.

XSS
CWE-79, stated by GitHub advisory GHSA-4whp-jx7j-xvrm
local
AV:L in CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N (CVSS 4.0) from GitHub advisory GHSA-4whp-jx7j-xvrm
no authentication required
PR:N in CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N (CVSS 4.0) from GitHub advisory GHSA-4whp-jx7j-xvrm
Go
GHSA-4whp-jx7j-xvrm: go packages github.com/gohugoio/hugo
現在の段階
PAT
公開日時
公開から修正版まで
T+0d
CVSS 基本値
4.6 MEDIUM v4.0

ライフサイクル

横軸は UTC。点=分単位、幅広の帯=日付のみ、白抜き=不明または推定。
日時不明
DIS公開
12-01T02:24Z
PAT修正
12-01T03:01Z
ANA解析
記録なし
POCPoC
記録なし
ITW悪用
記録なし
KEVKEV
記録なし

概要

### Summary

The wrapperClass option of the built-in highlight shortcode (and the transform.Highlight template function) was written unescaped into the wrapping <div class="...">, allowing a content author to inject arbitrary HTML/JavaScript into the rendered page.

### Details

markup/highlight/highlight.go (writeDivStart) wrote wrapperClass directly between class=" and ", while all other attribute values were HTML-escaped. Because the shortcode's options string is decoded into the highlight config, any content author can set wrapperClass. The Goldmark unsafe setting does not apply, as the value never passes through the Markdown HTML renderer. Markdown code fences are not affected.

Fixed by HTML-escaping the value.

### Proof of concept

A content author on a multi-author site adds a highlight shortcode to a page with a wrapperClass option value that closes the class attribute and appends a <script> element. When the site is built, the script ends up in the page body and runs in visitors' browsers under the site's origin.

### Impact

Stored XSS for sites that render content from less-trusted authors. The highlight shortcode is built in and enabled by default.

Original text of GitHub advisory GHSA-4whp-jx7j-xvrm, shown as published.

Exploit conditions

What an attack needs, read from the CVSS vector.
Attack vector AV:L
Local: needs a local or SSH session, or a user tricked into acting on the machine
Attack complexity AC:L
Low: no target-specific security measures to get around
Attack requirements AT:N
None: success does not depend on how the target is deployed or running
Privileges required PR:N
None: no account or authorization needed
User interaction UI:A
Active: a user must deliberately do something specific, such as install or run a file or dismiss a warning

CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N

CVSS 4.0 vector from GitHub advisory GHSA-4whp-jx7j-xvrm.

イベント履歴

+DIS公開

ghsa が公開を報告。

出典 ghsa · nday が にリアルタイムで観測 · 生データ
{
  "id": 563246,
  "type": "disclosed",
  "source": "ghsa",
  "url": "https://github.com/advisories/GHSA-4whp-jx7j-xvrm",
  "occurred_at": "2026-12-01T02:24:46Z",
  "observed_at": "2026-12-01T03:01:52.315373Z",
  "is_backfill": false,
  "dedupe_key": "GHSA-4whp-jx7j-xvrm",
  "detail": {
    "state": "PUBLISHED",
    "ghsa_id": "GHSA-4whp-jx7j-xvrm",
    "withdrawn_at": null
  }
}
ソースに時刻なし、nday が観測
+PAT修正版公開

アドバイザリ記載の修正済みバージョン:github.com/gohugoio/hugo 0.170.0。修正コミットへのリンクあり。アドバイザリの公開は 。修正版そのもののリリース日時は記録なし。

出典 ghsa · nday が にリアルタイムで観測 · 生データ
{
  "id": 563247,
  "type": "patch_released",
  "source": "ghsa",
  "url": "https://github.com/advisories/GHSA-4whp-jx7j-xvrm",
  "occurred_at": null,
  "observed_at": "2026-12-01T03:01:52.315373Z",
  "is_backfill": false,
  "dedupe_key": "GHSA-4whp-jx7j-xvrm",
  "detail": {
    "cvss": {
      "cvss_v3": {
        "score": 0.0,
        "vector_string": null
      },
      "cvss_v4": {
        "score": 4.6,
        "vector_string": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N"
      }
    },
    "cwes": [
      {
        "name": "Improper Neutralization of Input During Web Page Generation",
        "cwe_id": "CWE-79"
      }
    ],
    "ghsa_id": "GHSA-4whp-jx7j-xvrm",
    "packages": [
      {
        "name": "github.com/gohugoio/hugo",
        "ecosystem": "go",
        "first_patched_version": "0.170.0",
        "vulnerable_version_range": ">= 0.140.2, < 0.170.0"
      }
    ],
    "severity": "medium",
    "references": [
      "https://github.com/gohugoio/hugo/security/advisories/GHSA-4whp-jx7j-xvrm",
      "https://github.com/gohugoio/hugo/pull/15564",
      "https://github.com/gohugoio/hugo/commit/bdde5aa5155c6c349a743e71dc846bef754b6773",
      "https://github.com/gohugoio/hugo/releases/tag/v0.170.0",
      "https://github.com/advisories/GHSA-4whp-jx7j-xvrm"
    ],
    "fix_commit_urls": [
      "https://github.com/gohugoio/hugo/pull/15564",
      "https://github.com/gohugoio/hugo/commit/bdde5aa5155c6c349a743e71dc846bef754b6773"
    ],
    "github_reviewed_at": "2026-12-01T02:24:46Z",
    "advisory_updated_at": "2026-12-01T02:24:46Z",
    "source_code_location": "https://github.com/gohugoio/hugo",
    "advisory_published_at": "2026-12-01T02:24:46Z"
  }
}

Report an error

report an error or omission

Something on this page wrong or missing? Tell the editors; if they accept it, this page's revision log says so publicly. Upstream data is not changed.

Discussion

0 comments

No comments yet.