Categories
CVE-2026-72782 medium CVSS 6.5

Vulnerability in craftcms/cms (CVE-2026-72782)

Summary

Vulnerability in craftcms/cms (CVE-2026-72782). Confidential information can be exposed externally. Exploitable via CRAFT_SECURITY_KEY. Mitigation: upgrade to 4.18.2 or later.

Original description

The description as published by the source.

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.

The Craft vulnerability CVE-2026-31857 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.

However, 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.

Afterward, 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.

The 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 pr…

Source: NIST National Vulnerability Database NVD GitHub Advisory

Auto-generated summary

Assembled by SecPulse from the source data (CVSS, CWE, affected versions) using templates — no AI involved. Check the original description and references below for exact details.

A vulnerability tracked as CVE-2026-72782 has been found in craftcms/cms.
Attackers can target a specific entry point like CRAFT_SECURITY_KEY over the network to misuse the product.
Confidential information can be exposed externally. CVSS score: 6.5/10.
What to do: upgrade craftcms/cms to 4.18.2 or later.
If unsure, ask your IT team or search "craftcms/cms CVE-2026-72782" on the vendor's site.

CVE-2026-72782 (craftcms/cms) — CWE-668 / CVSS v3 6.5
Attack vector: remote (network-reachable) / no user interaction
Attack surface: CRAFT_SECURITY_KEY
Patched: 4.18.2 — apply immediately
Plan: 1) Audit SBOM/dependencies, 2) Stage→prod upgrade, 3) Add WAF/proxy monitoring on affected endpoints, 4) Hunt IOCs in logs.
Refs: see the GHSA / vendor advisory / patched release linked on this page.

❓ What is the problem

A vulnerability (CWE-668) exists in craftcms/cms. Attackers reach the vulnerable code path via CRAFT_SECURITY_KEY.

📍 Affected scope

Check the vendor advisory for the affected versions of craftcms/cms. Attack surface: CRAFT_SECURITY_KEY.

🔥 Severity

Severity: Medium (CVSS 6.5/10). Confidential information can be exposed externally.

🔧 How to fix

Update to 4.18.2.

🛡️ Workaround

Until the patch is applied: disable the affected feature, apply WAF rules, or restrict access via network ACLs.

🔍 Detection

Search webserver/proxy logs for unusual request patterns matching this CVE's known IOCs. Run grep -r 'craftcms/cms' . against your dependency files (package-lock.json, requirements.txt, go.sum) to find affected services.

Response actions

Concrete steps and command examples for SOC/SRE teams to execute in order

  1. 1
    Identify exposure identify
    grep -r 'craftcms/cms' . | grep -v node_modules

    リポジトリと本番環境の依存ファイル (package-lock.json / requirements.txt / go.sum / Gemfile.lock 等) で craftcms/cms を grep し、稼働しているサービス・バージョンを把握する。

  2. 2
    Apply patch patch
    Upgrade craftcms/cms to 4.18.2

    ステージング環境で 4.18.2 に上げて回帰テスト → 本番反映。回帰テストはアプリの主要ハッピーパスを含めること。

  3. 3
    Post-deployment verification verify
    Confirm patched version is live in production

    パッチ適用後、ステージングで PoC または同等の悪用パターンを再現して脆弱性が閉じたことを確認。本番ではアクセスログ・WAF でアラート再発が無いか継続監視。

Affected packages

composer craftcms/cms
[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"4.18.2"}]}]
Packagist craftcms/cms
[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0-RC1"},{"fixed":"4.18.2"}]}]

References

We use cookies for analytics and ad measurement. This setting applies to all Game co., Ltd. sites. Details