CVE-2024-21517: Cross site scripting in opencart
4.2
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.0676%
CWE
Published
6/22/2024
Updated
6/24/2024
KEV Status
No
Technology
PHP
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| opencart/opencart | composer | >= 4.0.0.0 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The vulnerability stems from improper handling of the 'redirect' parameter in two key functions:
- index() method directly passes untrusted GET input to the view without encoding
- login() method's validation (str_starts_with) can be bypassed through URL encoding tricks Both functions feed user-controlled data into the template which renders it unescaped in login.twig's hidden input. The commit shows removal of html_entity_decode in login() but maintains insufficient output encoding, leaving XSS possible despite partial fixes.