CVE-2024-41676: Openmage/magento lts Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-5vrp-638w-p8m2
CVSS 4.1
CWE-79
Published
Advisory Summary

CVE-2024-41676 is a MODERATE (CVSS 4.1) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Openmage/magento lts libraries in the Packagist ecosystem. The issue involves magento lts vulnerable to stored cross-site scripting (xss) in admin system configs. Remediation is available by upgrading affected packages to version 20.10.1.

CVE-2024-41676 at a Glance

CVE Identifier CVE-2024-41676
GHSA Identifier GHSA-5vrp-638w-p8m2
Severity MODERATE
CVSS v3.1 Base Score 4.1
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Openmage/magento lts
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 4.1

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2024-41676

To remediate this vulnerability, upgrade all affected Openmage/magento lts dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

openmage/magento-lts fixed: 20.10.1
Upgrade openmage/magento-lts to 20.10.1
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for openmage/magento-lts

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-41676, inspect your project dependencies for Openmage/magento lts:

inspect dependencies for openmage/magento-lts

Analyze the terminal output to locate any version of Openmage/magento lts in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 20.10.1), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where 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. In Openmage/magento lts, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact This XSS vulnerability is about the system configs * design/header/welcome * design/header/logo_src * design/header/logo_src_small * design/header/logo_alt They are intended to enable admins to set a text in the two cases, and to define an image url for the other two cases. But because of previously missing escaping allowed to input arbitrary html and as a consequence also arbitrary JavaScript. While this is in most usage scenarios not a relevant issue, some people work with more restrictive roles in the backend. Here the ability to inject JavaScript with these settings would be an unintended and unwanted privilege. ### Patches _Has the problem been patched? What versions should users upgrade to?_ The problem is patched with Version 20.10.1 or higher. ### Workarounds _Is there a way for users to fix or remediate the vulnerability without upgrading?_ Possible mitigations are * Restricting access to the System Configs * checking templates where these settings are used to apply proper html filtering ### For Users relying on this possibility Some Users might actually rely on the ability to use html there. You can restore the previous behavior by making use of the new introduced `->getUnescapedValue()` method on this escaped elements. Developers should have a look at the newly introduced `Mage_Core_Model_Security_HtmlEscapedString` ### Credit Credit goes to Aakash Adhikari @justlife4x4 for finding this issue

CVE-2024-41676 Affected Openmage/magento lts Versions

1 component(s)
Fixed Versions:
20.10.1
Product / Package Ecosystem Affected Versions Fixed Version
openmage/magento-lts
Packagist
< 20.10.1
20.10.1

References

Frequently Asked Questions

What is CVE-2024-41676?
CVE-2024-41676 is a security vulnerability in Openmage/magento lts involving Magento LTS vulnerable to stored Cross-site Scripting (XSS) in admin system configs under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Openmage/magento lts versions are affected?
Affected versions include releases prior to 20.10.1 across affected packages: openmage/magento-lts.
What version fixes CVE-2024-41676?
Upgrading to 20.10.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is openmage/magento-lts affected?
Yes, openmage/magento-lts is affected in releases prior to 20.10.1. Upgrade your dependency to 20.10.1 or later.
What is the CVSS score of CVE-2024-41676?
CVE-2024-41676 has a CVSS v3.1 base score of 4.1 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:L/A:N.
What CWE is associated with CVE-2024-41676?
CVE-2024-41676 is classified under CWE-79: 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.).
How can I check Packagist dependencies for CVE-2024-41676?
Run the dependency tree command: 'inspect dependencies for openmage/magento-lts'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-5vrp-638w-p8m2",
  "modified" : "2024-07-29T16:38:20Z",
  "published" : "2024-07-29T16:38:20Z",
  "aliases" : [ "CVE-2024-41676" ],
  "summary" : "Magento LTS vulnerable to stored Cross-site Scripting (XSS) in admin system configs",
  "details" : "### Impact\n\nThis XSS vulnerability is about the system configs\n* design/header/welcome\n* design/header/logo_src\n* design/header/logo_src_small\n* design/header/logo_alt\n\nThey are intended to enable admins to set a text in the two cases, and to define an image url for the other two cases.\nBut because of previously missing escaping allowed to input arbitrary html and as a consequence also arbitrary JavaScript.\n\nWhile this is in most usage scenarios not a relevant issue, some people work with more restrictive roles in the backend. Here the ability to inject JavaScript with these settings would be an unintended and unwanted privilege.\n\n### Patches\n_Has the problem been patched? What versions should users upgrade to?_  \n\nThe problem is patched with Version 20.10.1 or higher.\n\n### Workarounds\n_Is there a way for users to fix or remediate the vulnerability without upgrading?_  \n\nPossible mitigations are\n* Restricting access to the System Configs \n* checking templates where these settings are used to apply proper html filtering\n\n### For Users relying on this possibility\n\nSome Users might actually rely on the ability to use html there.\nYou can restore the previous behavior by making use of the new introduced `->getUnescapedValue()` method on this escaped elements. Developers should have a look at the newly introduced `Mage_Core_Model_Security_HtmlEscapedString`\n\n### Credit\n\nCredit goes to  Aakash Adhikari @justlife4x4 for finding this issue",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:C/C:N/I:L/A:N"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:H/UI:N/VC:N/VI:N/VA:N/SC:N/SI:L/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "openmage/magento-lts"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "20.10.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/OpenMage/magento-lts/security/advisories/GHSA-5vrp-638w-p8m2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-41676"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/OpenMage/magento-lts/commit/484cf8afc550e98bbf2c03fbb29a8450a32e7948"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/OpenMage/magento-lts"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-07-29T16:38:20Z",
    "nvd_published_at" : "2024-07-29T15:15:16Z"
  }
}