CVE-2026-21451: Bagisto/bagisto Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-2mwc-h2mg-v6p8
CWE-79
Published
Advisory Summary

CVE-2026-21451 is a MODERATE cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Bagisto/bagisto libraries in the Packagist ecosystem. The issue involves bagisto has html filter bypass that enables stored xss. Remediation is available by upgrading affected packages to version 2.3.10.

CVE-2026-21451 at a Glance

CVE Identifier CVE-2026-21451
GHSA Identifier GHSA-2mwc-h2mg-v6p8
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Bagisto/bagisto
Package Ecosystem Packagist
Published Date
Last Updated

How to Fix CVE-2026-21451

To remediate this vulnerability, upgrade all affected Bagisto/bagisto dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

bagisto/bagisto fixed: 2.3.10
Upgrade bagisto/bagisto to 2.3.10
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for bagisto/bagisto

How to Check if You Are Affected

To determine whether your application is affected by CVE-2026-21451, inspect your project dependencies for Bagisto/bagisto:

inspect dependencies for bagisto/bagisto

Analyze the terminal output to locate any version of Bagisto/bagisto in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 2.3.10), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Bagisto/bagisto, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary A stored Cross-Site Scripting (XSS) vulnerability exists in Bagisto 2.3.8 within the CMS page editor. Although the platform normally attempts to sanitize `<script>` tags, the filtering can be bypassed by manipulating the raw HTTP POST request before submission. As a result, arbitrary JavaScript can be stored in the CMS content and executed whenever the page is viewed or edited. This exposes administrators to a high-severity risk, including complete account takeover, backend hijacking, and malicious script execution. ### Details Bagisto’s CMS editor includes an HTML sanitation mechanism intended to protect against script injection by wrapping raw script content in `<div>` elements. However, this mechanism is applied only to requests submitted through the UI. When the CMS update request is intercepted and modified at the HTTP level, the sanitation layer fails to strip or encode embedded `<script>` tags. Because the back-end trusts the manipulated request, the malicious script is stored in the database exactly as submitted. When an administrator opens the CMS page (either in the editor or in the storefront), the JavaScript executes in the browser context with full admin privileges. The vulnerability stems from insufficient server-side sanitization. Sanitization logic appears to rely on client-side or UI-layer controls, leaving the underlying HTTP endpoint unprotected. ### PoC * A Bagisto 2.3.8 installation with access to the admin panel * Ability to intercept and modify outgoing CMS update requests (e.g., via a proxy tool) * Editing any CMS page (such as /admin/cms/edit/{id}) By introducing unfiltered script content directly into the HTTP payload; bypassing the UI-level sanitization the CMS endpoint accepts and stores the malicious JS. ### Steps to Reproduce 1. Log in as admin 2. Navigate to: /admin/cms/edit/1 3. Intercept the request (e.g., using Burp Suite) 4. Modify the en[html_content] field to include raw JavaScript: <img width="1166" height="580" alt="unnamed" src="https://github.com/user-attachments/assets/2163def6-02a4-46d3-b0bf-a66dcce00f55" /> <img width="1167" height="573" alt="unnamed" src="https://github.com/user-attachments/assets/ffe540aa-f7f9-4dc9-b934-6d2798cafa0a" /> > A video PoC has been prepared showing: * Normal CMS editing behavior * How the sanitation process is expected to work * How altering the raw request bypasses sanitization * Execution of the stored script once the page is loaded This helps illustrate both expected behavior and actual vulnerability behavior clearly. Video PoC: https://drive.google.com/file/d/1quGkBq1zwRhVrlJtVeDk9iQeUzqIyOM-/view ### Impact * Administrator account takeover * Session hijacking * Unauthorized actions performed in admin context * Defacement or injection of malicious content into public pages * Potential expansion into full application compromise ### Recommendations Implement server-side sanitization (e.g., HTMLPurifier or Laravel Purifier) to strip or encode <script> tags regardless of how the request is manipulated.

CVE-2026-21451 Affected Bagisto/bagisto Versions

1 component(s)
Fixed Versions:
2.3.10
Product / Package Ecosystem Affected Versions Fixed Version
bagisto/bagisto
Packagist
< 2.3.10
2.3.10

References

Frequently Asked Questions

What is CVE-2026-21451?
CVE-2026-21451 is a security vulnerability in Bagisto/bagisto involving Bagisto has HTML Filter Bypass that Enables Stored XSS under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Bagisto/bagisto versions are affected?
Affected versions include releases prior to 2.3.10 across affected packages: bagisto/bagisto.
What version fixes CVE-2026-21451?
Upgrading to 2.3.10 (or the latest patched release for your respective branch) resolves the vulnerability.
Is bagisto/bagisto affected?
Yes, bagisto/bagisto is affected in releases prior to 2.3.10. Upgrade your dependency to 2.3.10 or later.
What CWE is associated with CVE-2026-21451?
CVE-2026-21451 is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check Packagist dependencies for CVE-2026-21451?
Run the dependency tree command: 'inspect dependencies for bagisto/bagisto'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2mwc-h2mg-v6p8",
  "modified" : "2026-01-03T00:32:58Z",
  "published" : "2026-01-02T21:16:23Z",
  "aliases" : [ "CVE-2026-21451" ],
  "summary" : "Bagisto has HTML Filter Bypass that Enables Stored XSS",
  "details" : "### Summary\nA stored Cross-Site Scripting (XSS) vulnerability exists in Bagisto 2.3.8 within the CMS page editor. Although the platform normally attempts to sanitize `<script>` tags, the filtering can be bypassed by manipulating the raw HTTP POST request before submission. As a result, arbitrary JavaScript can be stored in the CMS content and executed whenever the page is viewed or edited.\nThis exposes administrators to a high-severity risk, including complete account takeover, backend hijacking, and malicious script execution.\n\n### Details\nBagisto’s CMS editor includes an HTML sanitation mechanism intended to protect against script injection by wrapping raw script content in `<div>` elements. However, this mechanism is applied only to requests submitted through the UI. When the CMS update request is intercepted and modified at the HTTP level, the sanitation layer fails to strip or encode embedded `<script>` tags.\n\nBecause the back-end trusts the manipulated request, the malicious script is stored in the database exactly as submitted. When an administrator opens the CMS page (either in the editor or in the storefront), the JavaScript executes in the browser context with full admin privileges.\n\nThe vulnerability stems from insufficient server-side sanitization.\nSanitization logic appears to rely on client-side or UI-layer controls, leaving the underlying HTTP endpoint unprotected.\n\n### PoC\n* A Bagisto 2.3.8 installation with access to the admin panel\n* Ability to intercept and modify outgoing CMS update requests (e.g., via a proxy tool)\n* Editing any CMS page (such as /admin/cms/edit/{id})\n\nBy introducing unfiltered script content directly into the HTTP payload; bypassing the UI-level sanitization the CMS endpoint accepts and stores the malicious JS.\n\n### Steps to Reproduce\n\n1. Log in as admin\n2. Navigate to: /admin/cms/edit/1\n3. Intercept the request (e.g., using Burp Suite)\n4. Modify the en[html_content] field to include raw JavaScript:\n\n<img width=\"1166\" height=\"580\" alt=\"unnamed\" src=\"https://github.com/user-attachments/assets/2163def6-02a4-46d3-b0bf-a66dcce00f55\" />\n\n<img width=\"1167\" height=\"573\" alt=\"unnamed\" src=\"https://github.com/user-attachments/assets/ffe540aa-f7f9-4dc9-b934-6d2798cafa0a\" />\n\n\n\n> A video PoC has been prepared showing:\n\n* Normal CMS editing behavior\n* How the sanitation process is expected to work\n* How altering the raw request bypasses sanitization\n* Execution of the stored script once the page is loaded\nThis helps illustrate both expected behavior and actual vulnerability behavior clearly.\n\nVideo PoC: https://drive.google.com/file/d/1quGkBq1zwRhVrlJtVeDk9iQeUzqIyOM-/view\n\n### Impact\n* Administrator account takeover\n* Session hijacking\n* Unauthorized actions performed in admin context\n* Defacement or injection of malicious content into public pages\n* Potential expansion into full application compromise\n\n### Recommendations\n\nImplement server-side sanitization (e.g., HTMLPurifier or Laravel Purifier) to strip or encode <script> tags regardless of how the request is manipulated.",
  "severity" : [ {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:N/SC:H/SI:H/SA:N/E:P"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "bagisto/bagisto"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.3.10"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/bagisto/bagisto/security/advisories/GHSA-2mwc-h2mg-v6p8"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-21451"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bagisto/bagisto/commit/f533b1cd9c80896792da60976179c95573d78b79"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/bagisto/bagisto"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/bagisto/bagisto/releases/tag/v2.3.10"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-02T21:16:23Z",
    "nvd_published_at" : "2026-01-02T21:16:02Z"
  }
}