Bagisto has HTML Filter Bypass that Enables Stored XSS
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
- Log in as admin
- Navigate to: /admin/cms/edit/1
- Intercept the request (e.g., using Burp Suite)
- Modify the en[html_content] field to include raw JavaScript:
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.
Affected software
Click a technology to see all vulnerabilities affecting it.
| Platform | Package | Vulnerable versions | Fixed in |
|---|---|---|---|
| Composer package | bagisto/bagisto | < 2.3.10 | 2.3.10 |
References
- CVSS vector
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- Weakness (CWE)
CWE-79- Platform
- Composer
- Package
bagisto/bagisto- Disclosed
- 02.01.2026
- Updated
- 11.10.2026 10:22
Sources and licenses
OSV / GitHub Advisory Database - GHSA-2mwc-h2mg-v6p8 - CC BY 4.0
Vulnerability history: bagisto/bagisto
All published vulnerabilities of this package (Composer package), newest first. Shows whether this is a one-off slip or a package that needs watching.
- Total entries
- 20
- First → latest
- 11.2019 04.2026
- Without a fix
- 2
- Exploited in attacks
- 0
Severity breakdown
- Critical 1
- High 8
- Medium 9
- Low 2
Disclosures per year
- 2019: 1
- 2020: 0
- 2021: 0
- 2022: 1
- 2023: 0
- 2024: 4
- 2025: 6
- 2026: 8
-
Bagisto has HTML Filter Bypass that Enables Stored XSS this entry
Know which vulnerabilities affect your application
With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.