Skip to content

chore: update module github.com/gohugoio/hugo to v0.163.3 [security] - #50

Open
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/go-github.com-gohugoio-hugo-vulnerability
Open

chore: update module github.com/gohugoio/hugo to v0.163.3 [security]#50
renovate[bot] wants to merge 1 commit into
mainfrom
renovate/go-github.com-gohugoio-hugo-vulnerability

Conversation

@renovate

@renovate renovate Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Change Age Confidence
github.com/gohugoio/hugo v0.147.6v0.163.3 age confidence

Hugo: Certain markdown links are not properly escaped

CVE-2026-35166 / GHSA-mcv8-8m8x-48pg

More information

Details

Impact

Links and image links in the default markdown to HTML renderer are not properly escaped. Hugo users who trust their Markdown content or have custom render hooks for links and images are not affected.

Patches

Patched in v0.159.2

Workarounds

Create custom render hooks for links and images in a Hugo theme/project.

Severity

  • CVSS Score: 5.3 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Hugo's Node tool execution allows file system access outside the project directory

CVE-2026-44301 / GHSA-x597-9fr4-5857

More information

Details

Impact

When building a Hugo site that uses Node-based asset pipelines (PostCSS, Babel, TailwindCSS), Hugo invoked the configured Node tools without restrictions on file system access. As a result, executing hugo against an untrusted site could allow code running through these tools to read or write files outside the project's working directory.

Users who do not use PostCSS, Babel, or TailwindCSS, or who only build trusted sites, are not affected.

Patches

From v0.161.0, Hugo runs Node tools under Node's permission model with strict defaults: No write access and only read access to the site source directories and files.

Workarounds

Block these tools in security.exec.allow.

Severity

  • CVSS Score: 6.2 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N/E:U

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Hugo: XSS via text/html content files

CVE-2026-50133 / GHSA-c54g-xjwj-8g82

More information

Details

Commit: e41a06447dDisallow HTML content by default
Affected versions: all Hugo versions prior to v0.162.0.
Fixed in: v0.162.0.
Severity: Low to Medium, depending on threat model. Not an issue if you fully trust every file under /content and every content adapter you load.

Description. Hugo accepts content files in several markup formats. Files mapped to the text/html media type (typically .html files under /content, or pages produced by a content adapter that sets content.mediaType = "text/html") had their body emitted verbatim into the rendered page. A site that ingests HTML content from an untrusted source — for example, a CMS-backed editor, a content adapter pulling from an external API, or an automated import pipeline — could therefore be served stored cross-site scripting.

Mitigation. v0.162.0 introduces a security.allowContent whitelist with text/html denied by default. Sites that intentionally author HTML content can opt back in:

[security]
allowContent = ['.*']

This only affects pages whose source file (or content adapter output) declares an HTML media type; Markdown, AsciiDoc, Org, Pandoc and reStructuredText content is unaffected.

Severity

  • CVSS Score: 5.1 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Hugo: security.http.urls allow-list bypass via HTTP redirects

CVE-2026-50134 / GHSA-vxgm-5rmg-5w8g

More information

Details

Commit: 86fbb0f7a8security: Validate redirects against security.http.urls
Affected versions: v0.91.0 (when security.http.urls was introduced) through v0.161.1.
Fixed in: v0.162.0.
Severity: Only relevant for sites that rely on security.http.urls as a trust boundary — e.g. CI builds that fetch remote resources but want to constrain which hosts can be reached. Not an issue if you fully trust every URL passed to resources.GetRemote.

Description. resources.GetRemote enforces security.http.urls on the URL it is called with, but until v0.162.0 it did not re-validate intermediate URLs on HTTP 3xx redirects. An allowed server (or an attacker controlling its DNS or response) could therefore redirect the request to a host that the policy was meant to forbid — for example, http://localhost/ or an internal IP — and Hugo would fetch from the redirected target. The same bypass also lifted any host-shape restriction the operator had put in place.

Mitigation. v0.162.0 installs a CheckRedirect on the HTTP client used by resources.GetRemote that re-runs security.http.urls on every redirect target and caps the redirect chain at 10 hops. No configuration change is required.

Severity

Medium

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Hugo: Symlink confinement bypass in resources.Get

CVE-2026-50135 / GHSA-fw87-fv5r-9fpw

More information

Details

Commit: f8b5fa09a6Fix prevention of direct symlink reads in resources.Get
Affected versions: v0.123.0 through v0.161.1. Earlier versions are not affected.
Fixed in: v0.162.0.
Severity: Medium. Requires the attacker to be able to place (or convince a site author to place) a symlink inside a mounted directory — for example, inside a locally-vendored theme under themes/. Themes mounted as Go modules from GitHub have symlinks stripped on download and are not affected. Multi-directory walks (e.g. content/asset walking) were not affected either; only direct lookups via resources.Get followed symlinks.

Description. Hugo's virtual filesystem is designed so that files under a mount cannot reach outside the mount tree. A regression introduced in v0.123.0 caused RootMappingFs.statRoot to call Stat (which follows symlinks) instead of Lstat, so a direct resources.Get "somefile" where somefile was a symlink pointing outside the mount would return the target's contents. This effectively let a symlink planted inside a theme or local mount read arbitrary files reachable to the user running hugo.

Mitigation. v0.162.0 calls LstatIfPossible and rejects symlinked entries with os.ErrNotExist, matching the behaviour of pre-v0.123.0 releases and of the directory-walking code paths.

Severity

  • CVSS Score: 6.9 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Hugo: Symlink confinement bypass in os.ReadFile

GHSA-c3wq-j5vh-68rc

More information

Details

Affected versions: v0.123.0 through v0.163.0. Earlier versions are not affected.
Fixed in: v0.163.1.
Severity: Medium. Requires the attacker to be able to place (or convince a site author to place) a symlink inside a mounted directory — for example, inside a locally-vendored theme under themes/. Themes mounted as Go modules from GitHub have symlinks stripped on download and are not affected. Multi-directory walks (e.g. content/asset walking) were not affected either; only direct lookups via resources.Get followed symlinks.

Description. Hugo's virtual filesystem is designed so that files under a mount cannot reach outside the mount tree. A regression introduced in v0.123.0 caused RootMappingFs.statRoot to call Stat (which follows symlinks) instead of Lstat, so a direct os.ReadFile "somefile" where somefile was a symlink pointing outside the mount would return the target's contents. This effectively let a symlink planted inside a theme or local mount read arbitrary files reachable to the user running hugo.

Severity

  • CVSS Score: 6.0 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:N/SC:H/SI:N/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Hugo: XSS via unescaped code-fence language in default code block renderer

GHSA-q76j-gcg9-vxc6

More information

Details

Hugo's default code-block renderer wrote the Markdown code-fence language / info-string into the <code class="language-…" data-lang="…"> wrapper without HTML escaping. A fence info-string containing a quote and a <script> payload breaks out of the attribute and injects a live script element.

This is not an issue if you fully trust every file under /content and every content adapter you load.

Severity

  • CVSS Score: 5.1 / 10 (Medium)
  • Vector String: CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:N/VI:N/VA:N/SC:L/SI:L/SA:N

References

This data is provided by the GitHub Advisory Database (CC-BY 4.0).


Release Notes

gohugoio/hugo (github.com/gohugoio/hugo)

v0.163.3

Compare Source

What's Changed

v0.163.2

Compare Source

What's Changed

v0.163.1

Compare Source

The majority of the fixes in this release are security related (including the upstream fix in 93c8c7d (golang.org/x/image)). Thanks to @​vnth4nhnt for finding the issues fixed in a00b5c7 and cf9c8f9 (I will do the CVE work on this later). There has been a uptick in security reports lately, which doesn't mean that Hugo has gotten less secure, this is mostly the work of the new and powerful AI tools using Hugo's restrictive security model as their baseline. Just take a look at Go's recent security issue list to see a demonstration of this.

What's Changed

v0.163.0

Compare Source

The main topic in this release is improvements to the AVIF image handling that we introduced in v0.162.0. See the docs for details, but:

  • We have turned down the default quality for AVIF to 60. Turns out, JPEG/WebP with quality 75 is comparable to AVIF with quality 60. You can now also set quality per image format in your project config (and also per image processed if needed).
  • We have added a hint to the AVIF with the same values as for WEBP. For lossy compression, the photo/picture hints (and the default) encodes with YUV420 chroma subsampling instead of YUV444, keeping 444 for text/icon/drawing. This greatly reduces the memory needed to encode these images.

Improvements

Dependency Updates

v0.162.1

Compare Source

What's Changed

v0.162.0

Compare Source

The notable new feature in this release is support for AVIF images (both encoder and decoder). There's a demo site set up that demonstrates the difference between HDR AVIF and SDR JPEG images. Note that that demo is only really interesting if viewed on an HDR capable screen (e.g. Apple Retina).

Security fixes

There are some notable security fixes in this release.

Security fixes in Go

This release upgrades from Go 1.26.1 to 126.3, which brings a set of security fixes. Some relevant for Hugo are:

  • XSS in html/template (CVE-2026-39826 & CVE-2026-39823): Two separate vulnerabilities where escaper bypasses in html/template could lead to Cross-Site Scripting (XSS).
  • html/template: Fixes an issue where JS template literal contexts were incorrectly tracked across template branches, which could lead to improper content escaping.
Security fixes and hardening in Hugo

The following changes either fix a concrete issue or reduce the default attack surface of hugo builds.

  • Disallow text/html content files by default (e41a064). A new security.allowContent policy gates which content media types may be used for pages under /content. text/html is denied by default; sites that rely on hand-authored or adapter-emitted HTML content can opt back in with security.allowContent = ['.*'].
  • Re-check security.http.urls on every redirect hop in resources.GetRemote (86fbb0f).
  • Reject symlinked entries in resources.Get (f8b5fa0).

We will update this section later with links to CVEs where applicable.

All changes

v0.161.1

Compare Source

What's Changed

v0.161.0

Compare Source

This release contains two security hardening fixes:

  • We now run the Node tools PostCSS, Babel and TailwindCSS, by default, with the --permission flag with the permissions defined in security.node.permissions. This means that you need Node >= 22 installed and that css.TailwindCSS now requires that the Tailwind CSS CLI must be installed as a Node.js package. The standalone executable is no longer supported
  • We have made the defaults in security.http.urls more restrictive.

But there are some notable new features, as well:

Nested vars support in css.Build and css.Sass

A practical example in css.Build would be to have something like this in hugo.toml:

[params.style]
    primary    = "#&#8203;000000"
    background = "#ffffff"
    [params.style.dark]
        primary    = "#ffffff"
        background = "#&#8203;000000"

And in the stylesheet:

@&#8203;import "hugo:vars";
@&#8203;import "hugo:vars/dark" (prefers-color-scheme: dark);

:root {
  color-scheme: light dark;
}

Slice-based permalinks config

The permalinks configuration is now much more flexible (the old setup still works). It uses the same target matchers as in the cascade config, meaning you can now do:

permalinks:
  - target:
      kind: page
      path: "/books/**"
    pattern: /books/:year/:slug/
  - target:
      kind: section
      path: "/{books,books/**}"
    pattern: /libros/:sections[1:]
  - target:
      kind: page
    pattern: /other/:slug/

The above example isn't great, but it at least shows the gist of it.

A more flexible scheme for identifiers in filenames

What we had before was e.g. content/mypost.en.md which told Hugo that the content files was in English. With the new setup you could also name the file content/mypost._language_en_.md. This alone doesn't sound very useful, but this allows you to use more prefixes:

Prefix Description Relevant for
language_ Language Content and layout files.
role_ Role Content and layout files.
version_ Version Content and layout files.
outputformat_ Output format Layout files.
mediatype_ Media type Layout files.
kind_ Page kind Layout files.
layout_ Layout Layout files.

All Changes

v0.160.1

Compare Source

What's Changed

Note

PR body was truncated to here.


Configuration

📅 Schedule: (UTC)

  • Branch creation
    • At any time (no schedule defined)
  • Automerge
    • At any time (no schedule defined)

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate Bot added the security label Apr 15, 2026
@renovate

renovate Bot commented Apr 15, 2026

Copy link
Copy Markdown
Contributor Author

ℹ️ Artifact update notice

File name: server/go.mod

In order to perform the update(s) described in the table above, Renovate ran the go get command, which resulted in the following additional change(s):

  • 36 additional dependencies were updated
  • The go directive was updated for compatibility reasons

Details:

Package Change
go 1.24.4 -> 1.26.0
github.com/google/wire v0.6.0 -> v0.7.0
github.com/stretchr/testify v1.10.0 -> v1.11.1
golang.org/x/net v0.41.0 -> v0.55.0
cloud.google.com/go/auth v0.15.0 -> v0.20.0
cloud.google.com/go/compute/metadata v0.6.0 -> v0.9.0
github.com/GoogleCloudPlatform/opentelemetry-operations-go/internal/resourcemapping v0.51.0 -> v0.54.0
github.com/davecgh/go-spew v1.1.1 -> v1.1.2-0.20180830191138-d8f796af33cc
github.com/go-logr/logr v1.4.2 -> v1.4.3
github.com/googleapis/enterprise-certificate-proxy v0.3.6 -> v0.3.14
github.com/googleapis/gax-go/v2 v2.14.1 -> v2.21.0
github.com/mattn/go-isatty v0.0.20 -> v0.0.22
github.com/pelletier/go-toml/v2 v2.2.4 -> v2.3.1
github.com/pmezard/go-difflib v1.0.0 -> v1.0.1-0.20181226105442-5d4384ee4fb2
github.com/spf13/afero v1.14.0 -> v1.15.0
github.com/spf13/cast v1.8.0 -> v1.10.0
github.com/tdewolff/parse/v2 v2.8.1 -> v2.8.12
go.opentelemetry.io/auto/sdk v1.1.0 -> v1.2.1
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.59.0 -> v0.67.0
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.59.0 -> v0.67.0
go.opentelemetry.io/otel v1.35.0 -> v1.43.0
go.opentelemetry.io/otel/metric v1.35.0 -> v1.43.0
go.opentelemetry.io/otel/sdk v1.35.0 -> v1.43.0
go.opentelemetry.io/otel/trace v1.35.0 -> v1.43.0
golang.org/x/crypto v0.39.0 -> v0.51.0
golang.org/x/mod v0.25.0 -> v0.36.0
golang.org/x/oauth2 v0.28.0 -> v0.36.0
golang.org/x/sync v0.15.0 -> v0.21.0
golang.org/x/sys v0.33.0 -> v0.45.0
golang.org/x/text v0.26.0 -> v0.38.0
golang.org/x/time v0.11.0 -> v0.15.0
golang.org/x/tools v0.33.0 -> v0.45.0
google.golang.org/api v0.228.0 -> v0.276.0
google.golang.org/genproto/googleapis/api v0.0.0-20250313205543-e70fdf4c4cb4 -> v0.0.0-20260319201613-d00831a3d3e7
google.golang.org/genproto/googleapis/rpc v0.0.0-20250313205543-e70fdf4c4cb4 -> v0.0.0-20260401024825-9d38bb4040a9
google.golang.org/grpc v1.71.0 -> v1.80.0
google.golang.org/protobuf v1.36.6 -> v1.36.11

@renovate
renovate Bot force-pushed the renovate/go-github.com-gohugoio-hugo-vulnerability branch from 0fc434b to d8baf0d Compare May 8, 2026 13:47
@renovate renovate Bot changed the title chore: update module github.com/gohugoio/hugo to v0.159.2 [security] chore: update module github.com/gohugoio/hugo to v0.161.0 [security] May 8, 2026
@renovate
renovate Bot force-pushed the renovate/go-github.com-gohugoio-hugo-vulnerability branch from d8baf0d to 61dba48 Compare June 20, 2026 19:56
@renovate renovate Bot changed the title chore: update module github.com/gohugoio/hugo to v0.161.0 [security] chore: update module github.com/gohugoio/hugo to v0.162.0 [security] Jun 20, 2026
@renovate
renovate Bot force-pushed the renovate/go-github.com-gohugoio-hugo-vulnerability branch from 61dba48 to 98eeffd Compare June 24, 2026 03:09
@renovate renovate Bot changed the title chore: update module github.com/gohugoio/hugo to v0.162.0 [security] chore: update module github.com/gohugoio/hugo to v0.163.3 [security] Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants