CVE-2022-46147: Xblock drag and drop v2 Cross-Site Scripting Vulnerability

HIGH
Advisory Identifier: GHSA-qv6c-367r-3w6q
CVSS 8.4
CWE-80 CWE-79
Published
Advisory Summary

CVE-2022-46147 is a HIGH (CVSS 8.4) cross-site scripting vulnerability (CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)) affecting Xblock drag and drop v2 libraries in the PyPI ecosystem. The issue involves xblock vulnerable to cross-site scripting (xss). Remediation is available by upgrading affected packages to version 3.0.0.

CVE-2022-46147 at a Glance

CVE Identifier CVE-2022-46147
GHSA Identifier GHSA-qv6c-367r-3w6q
Severity HIGH
CVSS v3.1 Base Score 8.4
CWE Classification CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS)
Affected Product Xblock drag and drop v2
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.4

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:R/S:C/C:H/I:H/A:H).

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

How to Fix CVE-2022-46147

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

xblock-drag-and-drop-v2 fixed: 3.0.0
pip install xblock-drag-and-drop-v2>=3.0.0
Verify Direct and Transitive Dependencies

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

pip show xblock-drag-and-drop-v2

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2022-46147, inspect your installed packages using pip:

pip show xblock-drag-and-drop-v2

Analyze the terminal output to locate any version of Xblock drag and drop v2 in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.0.0), your application is affected.

Note: The pip show xblock-drag-and-drop-v2 command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS), where the product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages. In Xblock drag and drop v2, 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 XSS Vulnerability in multiple XBlock Fields. Any platform that has deployed the XBlock will be impacted. ### Patches https://github.com/openedx/xblock-drag-and-drop-v2/commit/53c4482f9bb6d8c7ccdf5253bd82c84a222b2492 The fix is compatible with all Open edX releases newer than Lilac. ### Workarounds None. ### References https://github.com/openedx/xblock-drag-and-drop-v2/pull/295#issuecomment-1277693864

CVE-2022-46147 Affected Xblock drag and drop v2 Versions

1 component(s)
Fixed Versions:
3.0.0
Product / Package Ecosystem Affected Versions Fixed Version
xblock-drag-and-drop-v2
PyPI
< 3.0.0
3.0.0

References

Frequently Asked Questions

What is CVE-2022-46147?
CVE-2022-46147 is a security vulnerability in Xblock drag and drop v2 involving XBlock vulnerable to Cross-Site Scripting (XSS) under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS).
Which Xblock drag and drop v2 versions are affected?
Affected versions include releases prior to 3.0.0 across affected packages: xblock-drag-and-drop-v2.
What version fixes CVE-2022-46147?
Upgrading to 3.0.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is xblock-drag-and-drop-v2 affected?
Yes, xblock-drag-and-drop-v2 is affected in releases prior to 3.0.0. Upgrade your dependency to 3.0.0 or later.
What is the CVSS score of CVE-2022-46147?
CVE-2022-46147 has a CVSS v3.1 base score of 8.4 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with CVE-2022-46147?
CVE-2022-46147 is classified under CWE-80: Improper Neutralization of Script-Related HTML Tags in a Web Page (Basic XSS) (The product receives input from an upstream component, but it does not neutralize or incorrectly neutralizes special characters such as "<", ">", and "&" that could be interpreted as web-scripting elements when they are sent to a downstream component that processes web pages.).
How can I check PyPI dependencies for CVE-2022-46147?
Run the dependency tree command: 'pip show xblock-drag-and-drop-v2'. 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-qv6c-367r-3w6q",
  "modified" : "2024-11-22T20:34:30Z",
  "published" : "2022-12-02T22:26:22Z",
  "aliases" : [ "CVE-2022-46147" ],
  "summary" : "XBlock vulnerable to Cross-Site Scripting (XSS) ",
  "details" : "### Impact\nXSS Vulnerability in multiple XBlock Fields.  Any platform that has deployed the XBlock will be impacted.\n\n### Patches\nhttps://github.com/openedx/xblock-drag-and-drop-v2/commit/53c4482f9bb6d8c7ccdf5253bd82c84a222b2492\n\nThe fix is compatible with all Open edX releases newer than Lilac.\n\n### Workarounds\nNone.\n\n### References\nhttps://github.com/openedx/xblock-drag-and-drop-v2/pull/295#issuecomment-1277693864\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "xblock-drag-and-drop-v2"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/openedx/xblock-drag-and-drop-v2/security/advisories/GHSA-qv6c-367r-3w6q"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-46147"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openedx/xblock-drag-and-drop-v2/pull/295#issuecomment-1277693864"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openedx/xblock-drag-and-drop-v2/commit/53c4482f9bb6d8c7ccdf5253bd82c84a222b2492"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openedx/xblock-drag-and-drop-v2/commit/68887d1b4a44325d2de7573d450e41129ba98b1a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/openedx/xblock-drag-and-drop-v2"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/openedx/xblock-drag-and-drop-v2/releases/tag/v3.0.0"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/xblock-drag-and-drop-v2/PYSEC-2022-43175.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79", "CWE-80" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-12-02T22:26:22Z",
    "nvd_published_at" : "2022-11-28T21:15:00Z"
  }
}