nday
GHSA-4whp-jx7j-xvrm

Hugo highlight wrapperClass option allows stored cross-site scripting

CVE 공개 당일 패치 기록. 해결 버전: github.com/gohugoio/hugo 0.170.0. PoC 출처 4곳 모두 미등재. 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.

이벤트 로그

+DISCVE 공개

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.