发布日期: 2024-12-30
版本号: v0.140.2

Hugo此次更新主要针对golang.org/x/net库中html.Parse函数的安全修复,该函数在Hugo中用于两个场景:从Asciidoctor渲染输出中提取目录内容,以及在启用构建统计时收集HTML类等信息。尽管该漏洞在Hugo中的实际利用可能性较低,但团队仍进行了修复以满足安全报告的规范性要求。此次更新还包含其他改进:优化了hugo gen chromastyles命令行工具的说明文档,升级了依赖项版本,修复了多语言配置切片错误,增加了输出格式未定义时的错误提示,解决了资源文件重复发布问题,并为代码高亮功能新增了wrapperClass配置项。

更新内容 (中文)

此次发布的时机源于golang.org/x/nethtml.Parse函数中的安全修复。该函数在Hugo中有两处使用:

  1. 从Asciidoctor渲染输出中提取目录
  2. 启用构建统计时收集HTML类等元素

虽然很难想象这在Hugo中会被如何利用,但我们理解许多用户希望获得干净的安全报告。详见此issue获取详细信息。

变更内容

  • hugo gen chromastyles旁打印CLI用法说明 83cec785c @diwasrimal
  • 构建(deps): 升级golang.org/x/net从0.32.0到0.33.0 4e52be8b9 @dependabot[bot]
  • config/allconfig: 修复语言配置切片问题 7888ac585 @jmooring #13201
  • config/allconfig: 当输出格式未定义时报错 eb1dbe070 @jmooring #13199
  • 修复同一资源文件多次发布问题 77824d704 @bep #13164
  • markup/highlight: 新增wrapperClass选项 ec0caaec7 @bep
  • 更新README.md 845b8885d @bep

更新内容 (原始)

The timing of this release comes from the security fix in golang.org/x/net’s html.Parse function. This is used in two places in Hugo:

  1. Extracting table of contents from Asciidoctor rendered output.
  2. Collecting HTML classes etc. when build stats is enabled

It’s a little bit of a stretch to see how this could be exploited in Hugo, but we understand that many want a clean security report. See this issue for details.

What’s Changed

  • Print cli usage of hugo gen chromastyles alongside css 83cec785c @diwasrimal
  • build(deps): bump golang.org/x/net from 0.32.0 to 0.33.0 4e52be8b9 @dependabot[bot]
  • config/allconfig: Fix slice of language configs 7888ac585 @jmooring #13201
  • config/allconfig: Throw error when output format is not defined eb1dbe070 @jmooring #13199
  • Fix same resource file published more than once 77824d704 @bep #13164
  • markup/highlight: Add wrapperClass option ec0caaec7 @bep
  • Update README.md 845b8885d @bep

下载链接