Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS0yOTZxLXJqODMtZzlycc4AA-Ii

Reflected Cross Site-Scripting (XSS) in Oveleon Cookiebar

usd-2024-0009 | Reflected XSS in Oveleon Cookiebar

Details

Advisory ID: usd-2024-0009
Product: Cookiebar
Affected Version: 2.X
Vulnerability Type: CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Security Risk: HIGH, CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:A/VC:N/VI:L/VA:N/SC:L/SI:L/SA:N
Vendor URL: https://www.usd.de/
Vendor acknowledged vulnerability: Yes
Vendor Status: Fixed
CVE Number: Not requested yet
CVE Link: Not requested yet
First Published: Published
Last Update: 2024-07-29

Affected Component

The block function in CookiebarController.php.

Desciption

Oveleon's Cookiebar is an extension for the popular Contao CMS.
The block/locale endpoint does not properly sanitize the user-controlled locale input before including it in the backend's HTTP response, thereby causing reflected XSS.

Proof of Concept

The vulnerability could be triggered by entering the following Link:

https://[redacted].de/cookiebar/block/dens82w%22%3E%3Cimg%20src%3da%20onerror%3dalert(1)%3Ew9qt
n/[id]?redirect=https%3A%2F%2F[...]amp%3Biv_load_policy%3D3%26amp%3Bmo
destbranding%3D1%26amp%3Brel%3D0

It is likely related to the following function in the Oveleon Cookiebar source code:

    /**
     * Block content
     *
     * @Route("/cookiebar/block/{locale}/{id}", name="cookiebar_block")
     */
    public function block(Request $request, string $locale, int $id): Response
    {
        System::loadLanguageFile('tl_cookiebar', $locale);

        $this->framework->initialize();

        $objCookie = CookieModel::findById($id);

        if (null === $objCookie || null === $request->headers->get('referer'))
        {
            throw new PageNotFoundException();
        }

        $strUrl = $request->get('redirect');

        // Protect against XSS attacks
        if(!Validator::isUrl($strUrl))
        {
            return new Response('The redirect destination must be a valid URL.', Response::HTTP_BAD_REQUEST);
        }

        $objTemplate = new FrontendTemplate($objCookie->blockTemplate ?: 'ccb_element_blocker');

        $objTemplate->language = $locale;
        $objTemplate->id = $objCookie->id;
        $objTemplate->title = $objCookie->title;
        $objTemplate->type = $objCookie->type;
        $objTemplate->iframeType = $objCookie->iframeType;
        $objTemplate->description = $objCookie->blockDescription;
        $objTemplate->redirect = $request->get('redirect');
        $objTemplate->acceptAndDisplayLabel = $this->translator->trans('tl_cookiebar.acceptAndDisplayLabel', [], 'contao_default', $locale);

        return $objTemplate->getResponse();
    }

Fix

Sanitize the locale input to prevent XSS payloads from being executed in a user's browser.

References

Timeline

Credits

This security vulnerability was identified by DR of usd AG.

About usd Security Advisories

In order to protect businesses against hackers and criminals, we always have to keep our skills and knowledge up to date. Thus, security research is just as important for our work as is building up a security community to promote the exchange of knowledge. After all, more security can only be achieved if many individuals take on the task.

Our CST Academy and our usd HeroLab are essential parts of our security mission. We share the knowledge we gain in our practical work and our research through training courses and publications. In this context, the usd HeroLab publishes a series of papers on new vulnerabilities and current security issues.

Always for the sake of our mission: "more security."

https://www.usd.de

Disclaimer

The information provided in this security advisory is provided "as is" and without warranty of any kind. Details of this security advisory may be updated in order to provide as accurate information as possible.

Permalink: https://github.com/advisories/GHSA-296q-rj83-g9rq
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0yOTZxLXJqODMtZzlycc4AA-Ii
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: 4 months ago
Updated: 2 months ago


CVSS Score: 6.1
CVSS vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N

Identifiers: GHSA-296q-rj83-g9rq, CVE-2024-47069
References: Repository: https://github.com/oveleon/contao-cookiebar
Blast Radius: 0.0

Affected Packages

packagist:oveleon/contao-cookiebar
Dependent packages: 3
Dependent repositories: 1
Downloads: 88,258 total
Affected Version Ranges: >= 2.0.0, < 2.1.3, < 1.16.3
Fixed in: 2.1.3, 1.16.3
All affected versions: 1.0.0, 1.0.1, 1.0.2, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.2.4, 1.2.5, 1.2.6, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.4.0, 1.4.1, 1.4.2, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.4.8, 1.4.9, 1.5.0, 1.6.0, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9, 1.8.10, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.9.4, 1.9.5, 1.9.6, 1.9.7, 1.9.8, 1.9.9, 1.9.10, 1.9.11, 1.9.12, 1.10.0, 1.10.1, 1.10.2, 1.10.3, 1.10.4, 1.10.5, 1.10.6, 1.10.7, 1.11.0, 1.12.0, 1.12.1, 1.12.2, 1.12.3, 1.12.4, 1.12.5, 1.12.6, 1.12.7, 1.12.8, 1.12.9, 1.13.0, 1.13.1, 1.13.2, 1.13.3, 1.14.0, 1.14.1, 1.15.0, 1.15.1, 1.15.2, 1.16.0, 1.16.1, 1.16.2, 2.0.0, 2.0.1, 2.0.2, 2.1.0, 2.1.1, 2.1.2
All unaffected versions: 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0, 1.17.1, 1.17.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6, 2.1.7, 2.2.0, 2.2.1