Backtestshugorun-20260930-140149#15171

Issue #15171 Merged fix PR # Run 30 Sep 2026 · run-20260930-140149 gohugoio/hugo

Remove -embedded from the default exec.allow

Better

Our patch was judged better than the merged fix.

In this judgment, Patch B = our agent, Patch A = the merged fix.

The issue asks only to remove '-embedded' from the default exec.allow sass pattern. Patch B does exactly that: it changes '^(dart-)?sass(-embedded)?$' to '^(dart-)?sass$', updates the TOML test, and adds assertions to TestDecodeConfigDefault. Those assertions check that 'sass' and 'dart-sass' are still allowed and 'dart-sass-embedded' is now rejected, which would fail before the change and pass after it. B also updates the docs (Babel.md and docs.yaml) to match. Patch A makes the same sass change but also removes '^tailwindcss$' from the default allow list. That was not requested, and it is a behavior-breaking regression: users running TailwindCSS with default config would suddenly be blocked. A papers over this by editing the tailwind integration tests to add tailwindcss to exec.allow explicitly, which shows the breakage rather than justifying it. A also adds no new behavioral assertions beyond the TOML string update. B is correct, well-tested, and properly scoped. A adds risk through unrelated removal of a default.

The judge saw only the two patches, labelled A and B in random order, with issue links and version numbers removed. The reasoning above is shown verbatim.

Solve

26m 46s18 turns

Wall-clock time in the container

Full test suite

No new failures

3,694 passed · 99 skipped · 3,802 total

Contamination audit

Clean

No sign the agent saw the real fix

Patch size

17vs 15 merged

Changed lines, ours vs merged

Not relevant anymore.

The two patches

Our patch+10 −7
config/security/securityConfig.goindex 510abe6bb..06d7287a5 100644@@ -39,10 +39,10 @@ const securityConfigKey = "security" var DefaultConfig = Config{ 	Exec: Exec{ 		Allow: MustNewWhitelist(-			"^(dart-)?sass(-embedded)?$", // sass, dart-sass, dart-sass-embedded.-			"^go$",                       // for Go Modules-			"^git$",                      // For Git info-			"^node$",                     // Used as the runtime for Node tools.+			"^(dart-)?sass$", // sass, dart-sass.+			"^go$",           // for Go Modules+			"^git$",          // For Git info+			"^node$",         // Used as the runtime for Node tools. 			"^postcss$", 			"^tailwindcss$", 		),config/security/securityConfig_test.goindex 69feae858..4d14c21e7 100644@@ -135,7 +135,7 @@ func TestToTOML(t *testing.T) { 	got := DefaultConfig.ToTOML()  	c.Assert(got, qt.Equals,-		"[security]\n  allowContent = ['! ^text/html$']\n  enableInlineShortcodes = false\n\n  [security.exec]\n    allow = ['^(dart-)?sass(-embedded)?$', '^go$', '^git$', '^node$', '^postcss$', '^tailwindcss$']\n    osEnv = ['(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\\w+|(XDG_CONFIG_)?HOME|USERPROFILE|SSH_AUTH_SOCK|DISPLAY|LANG|SYSTEMDRIVE|PROGRAMDATA)$']\n\n  [security.funcs]\n    getenv = ['^HUGO_', '^CI$']\n\n  [security.http]\n    methods = ['(?i)GET|POST']\n    urls = ['(?i)^https?://[a-z0-9]', '! ^https?://\\d+\\.', '! (?i)localhost', '! (?i)^https?://[^/?#]*@']\n\n  [security.node]\n    [security.node.permissions]\n      allowAddons = ['tailwindcss']\n      allowChildProcess = ['tailwindcss']\n      allowRead = ['.']\n      allowWorker = ['tailwindcss']\n      allowWrite = []\n      disable = false",+		"[security]\n  allowContent = ['! ^text/html$']\n  enableInlineShortcodes = false\n\n  [security.exec]\n    allow = ['^(dart-)?sass$', '^go$', '^git$', '^node$', '^postcss$', '^tailwindcss$']\n    osEnv = ['(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\\w+|(XDG_CONFIG_)?HOME|USERPROFILE|SSH_AUTH_SOCK|DISPLAY|LANG|SYSTEMDRIVE|PROGRAMDATA)$']\n\n  [security.funcs]\n    getenv = ['^HUGO_', '^CI$']\n\n  [security.http]\n    methods = ['(?i)GET|POST']\n    urls = ['(?i)^https?://[a-z0-9]', '! ^https?://\\d+\\.', '! (?i)localhost', '! (?i)^https?://[^/?#]*@']\n\n  [security.node]\n    [security.node.permissions]\n      allowAddons = ['tailwindcss']\n      allowChildProcess = ['tailwindcss']\n      allowRead = ['.']\n      allowWorker = ['tailwindcss']\n      allowWrite = []\n      disable = false", 	) } @@ -149,6 +149,9 @@ func TestDecodeConfigDefault(t *testing.T) { 	c.Assert(pc.Exec.Allow.Accept("a"), qt.IsFalse) 	c.Assert(pc.Exec.Allow.Accept("node"), qt.IsTrue) 	c.Assert(pc.Exec.Allow.Accept("npx"), qt.IsFalse)+	c.Assert(pc.Exec.Allow.Accept("sass"), qt.IsTrue)+	c.Assert(pc.Exec.Allow.Accept("dart-sass"), qt.IsTrue)+	c.Assert(pc.Exec.Allow.Accept("dart-sass-embedded"), qt.IsFalse)  	c.Assert(pc.HTTP.URLs.Accept("https://example.org"), qt.IsTrue) 	c.Assert(pc.HTTP.Methods.Accept("POST"), qt.IsTrue)docs/content/en/functions/js/Babel.mdindex 26b5a16e7..1b04c8fc4 100644@@ -51,7 +51,7 @@ Step 5    {{< code-toggle file=hugo >}}   [security.exec]-    allow = ['^(dart-)?sass(-embedded)?$', '^go$', '^git$', '^node$', '^postcss$', '^tailwindcss$', '^babel$']+    allow = ['^(dart-)?sass$', '^go$', '^git$', '^node$', '^postcss$', '^tailwindcss$', '^babel$']   {{< /code-toggle >}}  Step 6docs/data/docs.yamlindex 19b950dd5..43733812d 100644@@ -2224,7 +2224,7 @@ config:     enableInlineShortcodes: false     exec:       allow:-      - ^(dart-)?sass(-embedded)?$+      - ^(dart-)?sass$       - ^go$       - ^git$       - ^node$ 
Merged fix · PR #+9 −6
config/security/securityConfig.goindex 510abe6bb..daf642129 100644@@ -39,12 +39,11 @@ const securityConfigKey = "security" var DefaultConfig = Config{ 	Exec: Exec{ 		Allow: MustNewWhitelist(-			"^(dart-)?sass(-embedded)?$", // sass, dart-sass, dart-sass-embedded.-			"^go$",                       // for Go Modules-			"^git$",                      // For Git info-			"^node$",                     // Used as the runtime for Node tools.+			"^(dart-)?sass$", // sass, dart-sass+			"^go$",           // for Go Modules+			"^git$",          // For Git info+			"^node$",         // Used as the runtime for Node tools. 			"^postcss$",-			"^tailwindcss$", 		), 		// These have been tested to work with Hugo's external programs 		// on Windows, Linux and MacOS.config/security/securityConfig_test.goindex 69feae858..8318d5d6f 100644@@ -135,7 +135,7 @@ func TestToTOML(t *testing.T) { 	got := DefaultConfig.ToTOML()  	c.Assert(got, qt.Equals,-		"[security]\n  allowContent = ['! ^text/html$']\n  enableInlineShortcodes = false\n\n  [security.exec]\n    allow = ['^(dart-)?sass(-embedded)?$', '^go$', '^git$', '^node$', '^postcss$', '^tailwindcss$']\n    osEnv = ['(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\\w+|(XDG_CONFIG_)?HOME|USERPROFILE|SSH_AUTH_SOCK|DISPLAY|LANG|SYSTEMDRIVE|PROGRAMDATA)$']\n\n  [security.funcs]\n    getenv = ['^HUGO_', '^CI$']\n\n  [security.http]\n    methods = ['(?i)GET|POST']\n    urls = ['(?i)^https?://[a-z0-9]', '! ^https?://\\d+\\.', '! (?i)localhost', '! (?i)^https?://[^/?#]*@']\n\n  [security.node]\n    [security.node.permissions]\n      allowAddons = ['tailwindcss']\n      allowChildProcess = ['tailwindcss']\n      allowRead = ['.']\n      allowWorker = ['tailwindcss']\n      allowWrite = []\n      disable = false",+		"[security]\n  allowContent = ['! ^text/html$']\n  enableInlineShortcodes = false\n\n  [security.exec]\n    allow = ['^(dart-)?sass$', '^go$', '^git$', '^node$', '^postcss$']\n    osEnv = ['(?i)^((HTTPS?|NO)_PROXY|PATH(EXT)?|APPDATA|TE?MP|TERM|GO\\w+|(XDG_CONFIG_)?HOME|USERPROFILE|SSH_AUTH_SOCK|DISPLAY|LANG|SYSTEMDRIVE|PROGRAMDATA)$']\n\n  [security.funcs]\n    getenv = ['^HUGO_', '^CI$']\n\n  [security.http]\n    methods = ['(?i)GET|POST']\n    urls = ['(?i)^https?://[a-z0-9]', '! ^https?://\\d+\\.', '! (?i)localhost', '! (?i)^https?://[^/?#]*@']\n\n  [security.node]\n    [security.node.permissions]\n      allowAddons = ['tailwindcss']\n      allowChildProcess = ['tailwindcss']\n      allowRead = ['.']\n      allowWorker = ['tailwindcss']\n      allowWrite = []\n      disable = false", 	) } resources/resource_transformers/cssjs/tailwindcss_integration_test.goindex 03cd1e07e..21702c303 100644@@ -28,6 +28,7 @@ func TestTailwindV4Basic(t *testing.T) {  	files := ` -- hugo.toml --+security.exec.allow = ['^go$', '^git$', '^node$', '^tailwindcss$'] -- package.json -- {   "license": "MIT",@@ -72,6 +73,7 @@ func TestTailwindCSSImportContext(t *testing.T) { 	files := ` -- hugo.toml -- disableKinds = ['page','rss','section','sitemap','taxonomy','term']+security.exec.allow = ['^go$', '^git$', '^node$', '^tailwindcss$'] -- assets/css/main.css -- @import "tailwindcss"; @@ -112,6 +114,8 @@ func TestTailwindCSSNoInlineImportsIssue13719(t *testing.T) { disableKinds = ['page','rss','section','sitemap','taxonomy','term'] theme = 'my-theme' +security.exec.allow = ['^go$', '^git$', '^node$', '^tailwindcss$']+ [[module.mounts]] source = 'assets' target = 'assets' 

What the agent reported

dart-sass-embedded is no longer allowed by default. The official test gate (./bt-test) couldn't run: the container has no network, so Go couldn't download modules. I ran the same tests directly against a local module cache at /bt/cache/go-mod instead. There they fail without the fix and pass with it.

What was wrong: The default security.exec.allow still had ^(dart-)?sass(-embedded)?$. Hugo stopped supporting the old dart-sass-embedded binary in 0.139.0, so the -embedded part only allowed a program Hugo already refuses to use.

What I changed:

  • config/security/securityConfig.go:42: the default entry is now ^(dart-)?sass$ (the comment reads "sass, dart-sass."). Only whitespace changed on the neighbouring comment lines.
  • docs/content/en/functions/js/Babel.md and docs/data/docs.yaml: the default allow list shown there now matches the new value.
  • config/security/securityConfig_test.go:
  • TestDecodeConfigDefault now checks that sass and dart-sass are allowed and dart-sass-embedded is not.
  • TestToTOML's expected string changed only in the allow entry, to match the new default. This updates the expected value; it doesn't loosen the test.

Test evidence:

  • Old default restored: TestToTOML and TestDecodeConfigDefault both fail, the second on the dart-sass-embedded check.
  • With the fix: ok github.com/gohugoio/hugo/config/security.
  • Nearby tests also pass: the TestSecurityPolicies tests in hugolib, the root TestCommands/config tests (which print the security config), and the tocss/dartsass package.

What else was affected: Users who still have dart-sass-embedded installed see the same message as before: "unsupported Dart Sass version detected, please upgrade…". That check in resources/resource_transformers/tocss/dartsass/client.go:55 runs before the allowlist check, so the removed pattern never came into play for them.

Requirements:

  1. Remove -embedded from the default exec.allow: done, with the test evidence above.
  2. Keep the docs consistent: done in both docs files; a repo-wide search finds no other default allow list still containing -embedded.

The existing test in hugolib/securitypolicies_test.go:210 matches the error with sass(-embedded)?. It still works with the new default, so I left it alone. Everything is left as uncommitted edits; AGENTS.md and CLAUDE.md were already deleted before I started and I didn't touch them.