{
  "id": "CVE-2026-31857",
  "url": "https://poc.griffinguard.io/cve/CVE-2026-31857",
  "published_at": "2026-03-11T17:30:29.092Z",
  "title": "CraftCMS has an RCE vulnerability via relational conditionals in the control panel",
  "vendor": "craftcms",
  "product": "cms",
  "cvss": {
    "score": 8.8,
    "source": "nvd",
    "vector": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": {
    "created_at": "2026-08-24T18:21:09Z",
    "first_seen_at": "2026-11-14T11:25:11.578Z",
    "days_after_publication": 166,
    "repo": "TRX-0/CVE-2026-31857-craftcms-ssti",
    "source": "github"
  },
  "poc_repo_count": 5,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "Craft is a content management system (CMS). Prior to 5.9.9 and 4.17.4, a Remote Code Execution vulnerability exists in the Craft CMS 5 conditions system. The BaseElementSelectConditionRule::getElementIds() method passes user-controlled string input through renderObjectTemplate() -- an unsandboxed Twig rendering function with escaping disabled. Any authenticated Control Panel user (including non-admin roles such as Author or Editor) can achieve full RCE by sending a crafted condition rule via standard element listing endpoints. This vulnerability requires no admin privileges, no special permissions beyond basic control panel access, and bypasses all production hardening settings (allowAdminChanges: false, devMode: false, enableTwigSandbox: true). Users should update to the patched 5.9.9 or 4.17.4 release to mitigate the issue.",
  "cwe": "CWE-94",
  "cpes": [
    "cpe:2.3:a:craftcms:craft_cms:*:*:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:4.0.0:-:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:4.0.0:beta1:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:4.0.0:beta2:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:4.0.0:beta3:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:4.0.0:beta4:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:4.0.0:rc1:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:4.0.0:rc2:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:4.0.0:rc3:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:5.0.0:-:*:*:*:*:*:*",
    "cpe:2.3:a:craftcms:craft_cms:5.0.0:rc1:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 8.1,
    "nvd": 8.8
  },
  "repos": [
    {
      "repo": "TRX-0/CVE-2026-31857-craftcms-ssti",
      "url": "https://github.com/TRX-0/CVE-2026-31857-craftcms-ssti",
      "created_at": "2026-08-24T18:21:09Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 0,
      "is_poc": "yes",
      "kind": "exploit",
      "suspicion_score": 0,
      "suspicious": false,
      "suspicion_reasons": [],
      "status": "analyzed",
      "owner_created_at": "2016-04-06T14:00:57Z"
    },
    {
      "repo": "0xTatsuki/CVE-2026-31857",
      "url": "https://github.com/0xTatsuki/CVE-2026-31857",
      "created_at": "2026-09-29T17:03:46Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 0,
      "is_poc": "yes",
      "kind": "exploit",
      "suspicion_score": 0,
      "suspicious": false,
      "suspicion_reasons": [],
      "status": "analyzed",
      "owner_created_at": "2024-02-03T11:09:08Z"
    },
    {
      "repo": "0Asylum/CVE-2026-31857",
      "url": "https://github.com/0Asylum/CVE-2026-31857",
      "created_at": "2026-09-30T03:17:31Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 1,
      "is_poc": "yes",
      "kind": "exploit",
      "suspicion_score": 0,
      "suspicious": false,
      "suspicion_reasons": [],
      "status": "analyzed",
      "owner_created_at": "2026-06-09T17:36:32Z"
    },
    {
      "repo": "WhiteMachin3/CVE-2026-31857",
      "url": "https://github.com/WhiteMachin3/CVE-2026-31857",
      "created_at": "2026-10-05T17:57:10Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 0,
      "is_poc": "yes",
      "kind": "exploit",
      "suspicion_score": 0,
      "suspicious": false,
      "suspicion_reasons": [],
      "status": "analyzed",
      "owner_created_at": "2022-10-25T09:04:08Z"
    },
    {
      "repo": "kaizoku73/CVE-2026-31857-PoC",
      "url": "https://github.com/kaizoku73/CVE-2026-31857-PoC",
      "created_at": "2026-10-08T08:48:46Z",
      "first_seen_at": "2026-11-14T11:25:11.578Z",
      "stars": 1,
      "is_poc": "yes",
      "kind": "exploit",
      "suspicion_score": 0,
      "suspicious": false,
      "suspicion_reasons": [],
      "status": "analyzed",
      "owner_created_at": "2024-08-29T16:57:21Z"
    }
  ],
  "remediation": {
    "affected": [
      {
        "vendor": "craftcms",
        "product": "cms",
        "ranges": [
          "\u003e= 5.0.0-RC1, \u003c 5.9.9",
          "\u003e= 4.0.0-beta.1, \u003c 4.17.4"
        ],
        "fixed_in": [
          "5.9.9",
          "4.17.4"
        ]
      }
    ],
    "upgrade": [
      "Upgrade cms to 5.9.9 or 4.17.4 or later."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://github.com/craftcms/cms/security/advisories/GHSA-fp5j-j7j4-mcxc"
      },
      {
        "kind": "Patch",
        "url": "https://github.com/craftcms/cms/commit/8d4903647dcfd31b8d40ed027e27082013347a80"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [
    {
      "method": "POST",
      "path_template": "/index.php",
      "query_markers": [
        "p=admin/actions/users/login",
        "v=1790685103019",
        "p=admin/actions/element-indexes/count-elements",
        "v=1790456540747"
      ],
      "headers": [
        {
          "name": "Accept",
          "value": "application/json, text/plain, */*"
        },
        {
          "name": "X-Csrf-Token",
          "value": "{var}"
        },
        {
          "name": "X-Requested-With",
          "value": "XMLHttpRequest"
        }
      ],
      "body_markers": [
        "\"loginName\"",
        "\"password\"",
        "\"rememberMe\":\"\"",
        "\"elementType\":\"craft\\elements\\Entry\"",
        "\"source\":\"*\"",
        "\"filters\""
      ],
      "content_type": "application/json",
      "protocol": "https",
      "repos": [
        "0xTatsuki/CVE-2026-31857",
        "kaizoku73/CVE-2026-31857-PoC"
      ],
      "repo_count": 2,
      "confidence": 0.7,
      "evidence": [
        "0xTatsuki/CVE-2026-31857/CVE-2026-31857.py:63",
        "0xTatsuki/CVE-2026-31857/CVE-2026-31857.py:151",
        "kaizoku73/CVE-2026-31857-PoC/exploit.py:37",
        "kaizoku73/CVE-2026-31857-PoC/exploit.py:73"
      ]
    },
    {
      "method": "GET",
      "path_template": "///{var}",
      "protocol": "http",
      "repos": [
        "WhiteMachin3/CVE-2026-31857"
      ],
      "repo_count": 1,
      "confidence": 0.7,
      "evidence": [
        "WhiteMachin3/CVE-2026-31857/poc.py:50"
      ]
    },
    {
      "method": "GET",
      "path_template": "/admin/login",
      "protocol": "http",
      "repos": [
        "kaizoku73/CVE-2026-31857-PoC"
      ],
      "repo_count": 1,
      "confidence": 0.7,
      "evidence": [
        "kaizoku73/CVE-2026-31857-PoC/exploit.py:11"
      ]
    },
    {
      "method": "POST\" IF DATA IS NOT NONE ELSE \"GET",
      "path_template": "/index.php",
      "query_markers": [
        "{var}="
      ],
      "headers": [
        {
          "name": "Accept",
          "value": "application/json"
        },
        {
          "name": "X-Requested-With",
          "value": "XMLHttpRequest"
        }
      ],
      "protocol": "http",
      "repos": [
        "0Asylum/CVE-2026-31857"
      ],
      "repo_count": 1,
      "confidence": 0.7,
      "evidence": [
        "0Asylum/CVE-2026-31857/poc.py:73"
      ]
    }
  ],
  "rules": []
}
