CVE-2026-21449
PHP vulnerability analysis and mitigation

Overview

CVE-2026-21449 is a Server-Side Template Injection (SSTI) vulnerability in Bagisto, an open-source Laravel-based eCommerce platform developed by Webkul. The flaw allows low-privilege authenticated users to inject malicious template expressions through the first name and last name fields in their customer profile, potentially leading to Remote Code Execution (RCE). All versions prior to 2.3.10 are affected. The vulnerability was published on January 2, 2026, with a patch released the same day. It carries a CVSS v3.1 base score of 8.8 (High) and a CVSS v4.0 base score of 7.4 (High) (GitHub Advisory, Bagisto Advisory).

Technical details

The vulnerability is classified as CWE-1336 (Improper Neutralization of Special Elements Used in a Template Engine). Bagisto fails to sanitize user-supplied input in the first name and last name profile fields before passing them to the Blade or underlying template engine for rendering. An attacker with a standard (non-admin) customer account can submit template expressions such as {{7*7}}, which are evaluated server-side and return computed results (e.g., 49), confirming template injection. Escalating beyond arithmetic expressions, an attacker can craft payloads to execute arbitrary OS commands on the server. The attack requires only network access and a low-privilege account — no user interaction or elevated permissions are needed (GitHub Advisory, Bagisto Advisory).

Impact

Successful exploitation grants an attacker the ability to execute arbitrary commands on the server, resulting in full compromise of confidentiality, integrity, and availability of the affected Bagisto instance. An attacker could exfiltrate sensitive customer and payment data stored in the eCommerce database, modify application content or configurations, install backdoors, or disrupt service availability entirely. Given that Bagisto is an eCommerce platform, exploitation could also expose customer PII and financial information, with potential for lateral movement to other systems accessible from the server (GitHub Advisory, Bagisto Advisory).

Exploitability

A proof-of-concept (PoC) exploit is publicly available via the GitHub Security Advisory, including a demonstration video showing template injection via the customer profile page (Bagisto Advisory). The EPSS score is approximately 0.047% (9th percentile), indicating a currently low but non-negligible probability of exploitation in the wild within 30 days. There is no confirmed evidence of active in-the-wild exploitation at this time, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog. The low barrier to exploitation — requiring only a free customer account — makes this a significant risk for publicly accessible Bagisto storefronts (GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify publicly accessible Bagisto storefronts running versions prior to 2.3.10 using web search, Shodan, or Censys queries targeting Bagisto-specific HTTP headers or page content.
  2. Account Registration: Register a standard (non-admin) customer account on the target Bagisto instance via the public signup page (e.g., http://target.com/customer/register).
  3. Navigate to Profile: Log in and navigate to the customer profile edit page (e.g., http://target.com/customer/account/profile).
  4. Inject Template Payload: Enter a template expression such as {{7*7}} in the first name or last name field and save the profile. If the rendered output shows 49, the application is vulnerable.
  5. Escalate to RCE: Replace the arithmetic test payload with a more dangerous template expression capable of executing OS commands (e.g., using PHP function calls accessible through the template engine context) to achieve Remote Code Execution.
  6. Post-Exploitation: Use the RCE capability to establish a reverse shell, exfiltrate database credentials or customer data, or deploy a web shell for persistent access (Bagisto Advisory, GitHub Advisory).

Indicators of compromise

  • Network: Unusual outbound connections from the web server process to external IPs, particularly on non-standard ports (indicative of reverse shell activity); HTTP POST requests to /customer/account/profile containing template syntax characters such as {{, }}, {%, or %}.
  • Logs: Web server access logs showing profile update requests with encoded or raw template expressions in name parameters; application error logs referencing template engine evaluation failures or unexpected PHP function calls.
  • File System: Presence of newly created web shell files (e.g., .php files) in the Bagisto public or storage directories; unexpected modification timestamps on core application files.
  • Process: Unusual child processes spawned by the PHP-FPM or web server process (e.g., bash, sh, curl, wget, python) that are not part of normal application operation (Bagisto Advisory).

Mitigation and workarounds

The primary remediation is to upgrade Bagisto to version 2.3.10 or later, which addresses the SSTI vulnerability by properly sanitizing user-supplied input in name fields (GitHub Advisory, Bagisto Advisory). If immediate patching is not feasible, restrict access to the customer profile editing functionality to trusted users, or temporarily disable self-service account registration. Additionally, implement Web Application Firewall (WAF) rules to detect and block requests containing template injection patterns (e.g., {{, }}) in user input fields. Monitor application logs for suspicious template expressions as a detection measure until patching is complete.

Community reactions

The vulnerability was disclosed by Webkul's security team (devansh-webkul) via GitHub's coordinated disclosure process on January 2, 2026, with a patch released the same day, demonstrating a rapid vendor response (Bagisto Advisory). A technical write-up was published by Infinit Security at infinitsec.net, highlighting the SSTI vector via non-admin user name fields. The vulnerability was also tracked by INCIBE-CERT and referenced by Red Hat's security advisory database, indicating broad community awareness (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related PHP vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-59989CRITICAL9.2
  • PHP logoPHP
  • phalcon/cphalcon
NoYesAug 21, 2026
CVE-2026-63135HIGH8.2
  • PHP logoPHP
  • yourls/yourls
NoYesAug 21, 2026
GHSA-p2ch-c2c3-4xm5MEDIUM6.1
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026
GHSA-8hgv-xc77-jmcrMEDIUM5.1
  • PHP logoPHP
  • getgrav/grav
NoYesAug 21, 2026
GHSA-hq84-x37p-j6q5MEDIUM4.5
  • PHP logoPHP
  • winter/wn-backend-module
NoYesAug 20, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management