Bagisto has HTML Filter Bypass that Enables Stored XSS

Description

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.

Basic information

Type
reviewed
Severity
medium
Advisory on GitHub
Open advisory ↗
Repository advisory
Open repository advisory ↗
Source code
Browse source ↗
Published (advisory)
2026-01-02 21:16:23 UTC
Updated
2026-01-03 00:33:00 UTC
GitHub reviewed
2026-01-02 21:16:23 UTC
NVD published
2026-01-02

EPSS Score

Score Percentile
0.03% 8.76%

CVSS Scores

Base score Version Severity Vector
5.2 4.0
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 Click to expand
Attack vector (AV:N)
Could be attacked over the internet or any normal routed network.
Attack complexity (AC:L)
Exploitation conditions are straightforward and stable.
Attack requirements (AT:N)
No additional preconditions are required beyond normal reachability.
Privileges required (PR:H)
High privileges are required.
User interaction (UI:N)
No user interaction is required.
Vulnerable system confidentiality impact (VC:N)
No confidentiality impact on the vulnerable system.
Vulnerable system integrity impact (VI:N)
No integrity impact on the vulnerable system.
Vulnerable system availability impact (VA:N)
No availability impact on the vulnerable system.
Subsequent system confidentiality impact (SC:H)
High confidentiality impact on subsequent systems.
Subsequent system integrity impact (SI:H)
High integrity impact on subsequent systems.
Subsequent system availability impact (SA:N)
No availability impact on subsequent systems.
Exploit maturity (threat) (E:P)
Proof-of-concept: public PoC exists; no reported exploitation and no known simplification tools.

Identifiers

CWEs

CWE id Name
CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

Credits

  • cybercrew-analyst (reporter)

Affected packages (1)

Vulnerable version ranges and first patched releases as published by GitHub.

Ecosystem Package Vulnerable range First patched Vulnerable functions
composer bagisto/bagisto < 2.3.10 2.3.10

References

cvelogic Threat Intelligence