Skip to content

Commit f1fce6c

Browse files
1 parent f60341a commit f1fce6c

3 files changed

Lines changed: 236 additions & 0 deletions

File tree

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-596p-6jv8-775v",
4+
"modified": "2026-08-06T21:53:31Z",
5+
"published": "2026-08-06T21:53:31Z",
6+
"aliases": [],
7+
"summary": "Craft CMS: Authenticated leak of secret environment variables",
8+
"details": "Environment variables and secrets are interpolated into a Twig template even when the Twig sandbox is enabled, allowing them to be leaked by an authenticated attacker.\n\nThe Craft vulnerability [CVE-2026-31857](https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc) was only patched by applying sandboxed Twig templating. This theoretically protects Craft CMS against RCE attacks, provided the sandbox is enabled and secure, with no known bypasses.\n\nHowever, the same request parameter `elementId,` which allows for sandboxed Twig templates to be rendered, also includes functionality that interpolates referenced environment variables. If the parameter includes a string of the form `${ENV_VAR}` then the string is replaced with the environment variable or secret from a secrets file with that name.\n\nAfterward, the string is rendered as a Twig template. If the sandbox is disabled, Twig templates can already gain RCE or access environment variables using the getenv function. Sandboxed Twig templates should not have this access, but now do thanks to this additional environment-variable replacement behavior.\n\nThe template’s resulting value is not directly reflected in the response. To exfiltrate the value, the sandboxed Twig template cannot use network functions. But it can use a blind error-based approach similar to blind SQL injection. With enough requests, any environment variable or secret can be incrementally leaked. This can be abused to forge a session, escalate privileges with the `CRAFT_SECURITY_KEY`, and steal credentials for the database, SMTP server, or other connected APIs or blob storage.\n\n## Impact\n\nAn authenticated attacker, with permission to access the control panel, can render a malicious Twig template and steal arbitrary environment variables and secrets with a large number of requests, even if the Twig sandbox is enabled through `enableTwigSandbox()`.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Packagist",
19+
"name": "craftcms/cms"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "5.0.0-RC1"
27+
},
28+
{
29+
"fixed": "5.10.6"
30+
}
31+
]
32+
}
33+
]
34+
},
35+
{
36+
"package": {
37+
"ecosystem": "Packagist",
38+
"name": "craftcms/cms"
39+
},
40+
"ranges": [
41+
{
42+
"type": "ECOSYSTEM",
43+
"events": [
44+
{
45+
"introduced": "4.0.0-RC1"
46+
},
47+
{
48+
"fixed": "4.18.2"
49+
}
50+
]
51+
}
52+
]
53+
}
54+
],
55+
"references": [
56+
{
57+
"type": "WEB",
58+
"url": "https://github.com/craftcms/cms/security/advisories/GHSA-596p-6jv8-775v"
59+
},
60+
{
61+
"type": "PACKAGE",
62+
"url": "https://github.com/craftcms/cms"
63+
},
64+
{
65+
"type": "WEB",
66+
"url": "https://github.com/craftcms/cms/releases/tag/4.18.2"
67+
},
68+
{
69+
"type": "WEB",
70+
"url": "https://github.com/craftcms/cms/releases/tag/5.10.6"
71+
}
72+
],
73+
"database_specific": {
74+
"cwe_ids": [
75+
"CWE-668"
76+
],
77+
"severity": "MODERATE",
78+
"github_reviewed": true,
79+
"github_reviewed_at": "2026-08-06T21:53:31Z",
80+
"nvd_published_at": null
81+
}
82+
}
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-6hr6-w5qg-qmwg",
4+
"modified": "2026-08-06T21:53:41Z",
5+
"published": "2026-08-06T21:53:41Z",
6+
"aliases": [
7+
"CVE-2026-71554"
8+
],
9+
"summary": "h2: Duplicate Host header could facilitate request smuggling",
10+
"details": "### Impact\nh2 <=4.4.0 accepts request header blocks containing more than one Host header, and forwards every Host header to the consuming application. Where the consumer downgrades HTTP/2 to HTTP/1.1, the resulting request carries two Host header lines, which is a request smuggling primitive (CWE-444).\n\n### Patches\nPatched and fixed in v4.4.1\n\n### Workarounds\nUsers of the h2 library are advised to check and follow HTTP semantics best practices in their application code. h2 provides best effort sanity checks, but ultimately the calling code is responsible to ensure proper and safe usage of HTTP/2 as provided by h2, hyperframe, and hpack.\n\n### References\nSimilar to the previously disclosed and fixed duplicate content-length issue.",
11+
"severity": [
12+
{
13+
"type": "CVSS_V3",
14+
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
15+
}
16+
],
17+
"affected": [
18+
{
19+
"package": {
20+
"ecosystem": "PyPI",
21+
"name": "h2"
22+
},
23+
"ranges": [
24+
{
25+
"type": "ECOSYSTEM",
26+
"events": [
27+
{
28+
"introduced": "0"
29+
},
30+
{
31+
"fixed": "4.4.1"
32+
}
33+
]
34+
}
35+
],
36+
"database_specific": {
37+
"last_known_affected_version_range": "<= 4.4.0"
38+
}
39+
}
40+
],
41+
"references": [
42+
{
43+
"type": "WEB",
44+
"url": "https://github.com/python-hyper/h2/security/advisories/GHSA-6hr6-w5qg-qmwg"
45+
},
46+
{
47+
"type": "WEB",
48+
"url": "https://github.com/python-hyper/h2/commit/292a40829feefda98c8509dcdbbb4a57af9bd6a6"
49+
},
50+
{
51+
"type": "PACKAGE",
52+
"url": "https://github.com/python-hyper/h2"
53+
}
54+
],
55+
"database_specific": {
56+
"cwe_ids": [
57+
"CWE-444"
58+
],
59+
"severity": "MODERATE",
60+
"github_reviewed": true,
61+
"github_reviewed_at": "2026-08-06T21:53:41Z",
62+
"nvd_published_at": null
63+
}
64+
}
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
{
2+
"schema_version": "1.4.0",
3+
"id": "GHSA-957r-qf9p-67xw",
4+
"modified": "2026-08-06T21:54:45Z",
5+
"published": "2026-08-06T21:54:45Z",
6+
"aliases": [],
7+
"summary": "Craft CMS: Arbitrary file read via SplFileObject in non-sandboxed template contexts",
8+
"details": "The `create()` Twig function (introduced in 5.9.0) allows instantiation of arbitrary PHP classes from template code, restricted only by a 5-entry blocklist. `SplFileObject` is not in the blocklist, enabling arbitrary file read, including `.env` (security key, DB credentials) and the passwd file from non-sandboxed Twig template contexts, such as entry type title formats and URI formats. \n\nThe sandbox correctly blocks `create()` in system email templates, so this finding applies only to admin-configured, non-sandboxed contexts that require `allowAdminChanges=true`.\n\n## Prerequisites\n\n- Admin access to the Craft control panel\n- `allowAdminChanges` must be `true` (default in dev/staging, recommended `false` in production)\n- Admin must be able to edit entry type settings (title format, URI format)\n- Any user who subsequently creates an entry in the affected section triggers the file read\n\n## Limitations\n\n- Requires admin-level access: not exploitable by low-privilege users\n- `allowAdminChanges` must be `true`: production best practices recommend `false`, which prevents entry type configuration changes\n- Per Craft’s own severity guidelines, findings requiring `allowAdminChanges=true` are rated low\n- The `create()` function is blocked by the Twig sandbox, so this cannot be exploited via system email templates or any other sandboxed context\n\n## Impact\n\nAn admin user (or an attacker who has compromised an admin account) can read arbitrary files from the server filesystem by setting a malicious entry type title format using `create('SplFileObject', ['/path/to/file'])`. In production environments, this exposes `.env` files containing the `CRAFT_SECURITY_KEY`, database credentials, API keys, and other secrets. The file contents are rendered as entry titles visible to any user with permission to view entries in the affected section.\n\nThe impact is limited by the requirement for admin access and `allowAdminChanges=true`.",
9+
"severity": [
10+
{
11+
"type": "CVSS_V4",
12+
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N"
13+
}
14+
],
15+
"affected": [
16+
{
17+
"package": {
18+
"ecosystem": "Packagist",
19+
"name": "craftcms/cms"
20+
},
21+
"ranges": [
22+
{
23+
"type": "ECOSYSTEM",
24+
"events": [
25+
{
26+
"introduced": "5.0.0-RC1"
27+
},
28+
{
29+
"fixed": "5.10.6"
30+
}
31+
]
32+
}
33+
]
34+
},
35+
{
36+
"package": {
37+
"ecosystem": "Packagist",
38+
"name": "craftcms/cms"
39+
},
40+
"ranges": [
41+
{
42+
"type": "ECOSYSTEM",
43+
"events": [
44+
{
45+
"introduced": "4.0.0-RC1"
46+
},
47+
{
48+
"fixed": "4.18.2"
49+
}
50+
]
51+
}
52+
]
53+
}
54+
],
55+
"references": [
56+
{
57+
"type": "WEB",
58+
"url": "https://github.com/craftcms/cms/security/advisories/GHSA-957r-qf9p-67xw"
59+
},
60+
{
61+
"type": "WEB",
62+
"url": "https://github.com/craftcms/cms/commit/7c96fd73df936a10e8f85ae6ef61a9fc3f277c12"
63+
},
64+
{
65+
"type": "WEB",
66+
"url": "https://github.com/craftcms/cms/commit/87978f11c8f986c40ef41b941d79547230c4d6d9"
67+
},
68+
{
69+
"type": "PACKAGE",
70+
"url": "https://github.com/craftcms/cms"
71+
},
72+
{
73+
"type": "WEB",
74+
"url": "https://github.com/craftcms/cms/releases/tag/4.18.2"
75+
},
76+
{
77+
"type": "WEB",
78+
"url": "https://github.com/craftcms/cms/releases/tag/5.10.6"
79+
}
80+
],
81+
"database_specific": {
82+
"cwe_ids": [
83+
"CWE-184"
84+
],
85+
"severity": "MODERATE",
86+
"github_reviewed": true,
87+
"github_reviewed_at": "2026-08-06T21:54:45Z",
88+
"nvd_published_at": null
89+
}
90+
}

0 commit comments

Comments
 (0)