CVE-2024-6526 (PHP, published 2024-07-05T14:15Z)
Description: value: A vulnerability classified as problematic has been found in CodeIgniter Ecommerce-CodeIgniter-Bootstrap up to 1998845073cf433bc6c250b0354461fbd84d0e03. This affects an unknown part. The manipulation of the argument search_title/catName/sub/name/categorie leads to cross site scripting. It is possible to initiate the attack remotely. The exploit has been disclosed to the public and may be used. The identifier of the patch is 1b3da45308bb6c3f55247d0e99620b600bd85277. It is recommended to apply a patch to fix this issue. The identifier VDB-270369 was assigned to this vulnerability.
Severity: nan (CVSS v3 base score: 6.1)
Weakness: CWE-79 \u2014 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.
Repository: https://github.com/kirilkirkov/Ecommerce-CodeIgniter-Bootstrap
Files changed:
application/modules/admin/views/ecommerce/products.php
application/modules/admin/views/ecommerce/shopcategories.php
application/modules/admin/views/vendors/listVendors.php
application/views/templates/clothesshop/home.php
application/views/templates/clothesshop/vendor.php
application/views/templates/greenlabel/_parts/footer.php
application/views/templates/greenlabel/_parts/header.php
application/views/templates/greenlabel/shop.php
application/views/templates/greenlabel/vendor.php
application/views/templates/redlabel/_parts/footer.php
application/views/templates/redlabel/home.php
application/views/templates/redlabel/vendor.php
Commit message: Multiples xss in the application request to open a CVE #263


Vulnerable code:
                                <input class="form-control" placeholder="Product Title" type="text" value="<?= isset($_GET['search_title']) ? $_GET['search_title'] : '' ?>" name="search_title">
                        <td><?= $catName ?></td>
                                <div> <?= $sub ?> </div>
                                        $aa .= '[' . $ff['abbr'] . ']' . $ff['name'] . '/';
                    $aa .= '[' . $ff['abbr'] . ']' . $ff['name'] . '/';
                        <td><?= isset($vendor->name) ? $vendor->name : 'Vendor name is empty' ?></td>
                                    $product = unserialize($order['products']);
                                <span><?= $categorie['name'] ?></span>
                                <span><?= $categorie['name'] ?></span>
                                <li><a href="javascript:void(0);" data-categorie-id="<?= $key ?>" class="go-category"><?= $categorie ?></a></li>
                                                        <a href="javascript:void(0);" data-categorie-id="<?= $nav_category['id'] ?>" class="go-category <?= $children == true ? 'mega-title' : '' ?>"><?= $nav_category['name'] ?></a>
                                            <?= $page['name'] ?>
                                        <?= $page['name'] ?>
                                <li><a href="javascript:void(0);" data-categorie-id="<?= $key ?>" class="go-category"><?= $categorie ?></a></li>
                                        <?= $page['name'] ?>
                                        <?= $page['name'] ?>

Fixed code:
                                <input class="form-control" placeholder="Product Title" type="text" value="<?= isset($_GET['search_title']) ? htmlspecialchars($_GET['search_title'], ENT_QUOTES, 'UTF-8') : '' ?>" name="search_title">
                        <td><?= htmlspecialchars($catName, ENT_QUOTES, 'UTF-8') ?></td>
                                <div> <?= htmlspecialchars($sub, ENT_QUOTES, 'UTF-8') ?> </div>
                                        $aa .= '[' . $ff['abbr'] . ']' . htmlspecialchars($ff['name'], ENT_QUOTES, 'UTF-8') . '/';
                    $aa .= '[' . $ff['abbr'] . ']' . htmlspecialchars($ff['name'], ENT_QUOTES, 'UTF-8') . '/';
                        <td><?= isset($vendor->name) ? htmlspecialchars($vendor->name, ENT_QUOTES, 'UTF-8') : 'Vendor name is empty' ?></td>
                                    $product = unserialize($order['products'], ["allowed_classes" => false]);
                                <span><?= htmlspecialchars($categorie['name'], ENT_QUOTES, 'UTF-8') ?></span>
                                <span><?= htmlspecialchars($categorie['name'], ENT_QUOTES, 'UTF-8') ?></span>
                                <li><a href="javascript:void(0);" data-categorie-id="<?= $key ?>" class="go-category"><?= htmlspecialchars($categorie, ENT_QUOTES, 'UTF-8') ?></a></li>
                                                        <a href="javascript:void(0);" data-categorie-id="<?= $nav_category['id'] ?>" class="go-category <?= $children == true ? 'mega-title' : '' ?>"><?= htmlspecialchars($nav_category['name'], ENT_QUOTES, 'UTF-8') ?></a>
                                            <?= htmlspecialchars($page['name'], ENT_QUOTES, 'UTF-8') ?>
                                        <?= htmlspecialchars($page['name'], ENT_QUOTES, 'UTF-8') ?>
                                <li><a href="javascript:void(0);" data-categorie-id="<?= $key ?>" class="go-category"><?= htmlspecialchars($categorie, ENT_QUOTES, 'UTF-8') ?></a></li>
                                        <?= htmlspecialchars($page['name'], ENT_QUOTES, 'UTF-8') ?>
                                        <?= htmlspecialchars($page['name'], ENT_QUOTES, 'UTF-8') ?>