nday
GHSA-4whp-jx7j-xvrm

Hugo highlight wrapperClass option allows stored cross-site scripting

披露当天有补丁记录。已有补丁记录,修复版本是 github.com/gohugoio/hugo 0.170.0。四个 PoC 来源都还没有收录。尚未列入 CISA KEV。

标签 漏洞类型XSS 攻击途径本地无需认证 软件包生态Go
这些标签的依据

这些标签由 nday 按固定规则从下列事实自动推导,不是 NVD、编号分配方或其他来源给出的。全部标签和规则见 ~/tags。

XSS
CWE-79(来源:GitHub 公告 GHSA-4whp-jx7j-xvrm)
本地
GitHub 公告 GHSA-4whp-jx7j-xvrm 给出的 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)中的 AV:L
无需认证
GitHub 公告 GHSA-4whp-jx7j-xvrm 给出的 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)中的 PR:N
Go
GHSA-4whp-jx7j-xvrm:go 包 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.

以上是 GitHub 安全公告 GHSA-4whp-jx7j-xvrm 中的原文,未经改写。

利用条件

按 CVSS 向量说明攻击需要的条件。
攻击途径 AV:L
本地:需要本地或 SSH 会话,或诱使用户在本机上操作
攻击复杂度 AC:L
低:不需要绕过目标特有的安全防护
攻击前提 AT:N
无:能否成功与目标的部署和运行条件无关
所需权限 PR:N
无:不需要账号或授权
用户交互 UI:A
主动:须有用户特意执行特定操作,例如安装或运行文件、忽略安全警告

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 向量,来自 GitHub 安全公告 GHSA-4whp-jx7j-xvrm。

事件记录

+DIS披露

ghsa 报告了披露事件。

来源 ghsa · 本站 实时观测 · 原始记录
{
  "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
  }
}
来源未给时间,本站实时观测
+PAT补丁发布

公告给出修复版本 github.com/gohugoio/hugo 0.170.0。公告附有修复提交。公告本身发布于 ,补丁实际发布时间没有记录。

来源 ghsa · 本站 实时观测 · 原始记录
{
  "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"
  }
}

纠错

报告错误或缺失

页面有误或缺失?告诉编辑;采纳后在本页修订记录公开说明,上游数据不会被改动。

讨论

0 条评论

还没有评论。