CVE-2022-31777: Apache Spark vulnerable to Log Injection

CVE-2022-31777 · Severity: low · CVSS 3.1 · Published 2022-11-01

A stored cross-site scripting (XSS) vulnerability in Apache Spark 3.2.1 and earlier, and 3.3.0, allows remote attackers to execute arbitrary JavaScript in the web browser of a user, by including a malicious payload into the logs which would be returned in logs rendered in the UI.

Technologies: org.apache.spark:spark-core_2.10 (Maven), org.apache.spark:spark-core_2.11 (Maven), org.apache.spark:spark-core_2.12 (Maven), org.apache.spark:spark-core_2.13 (Maven), pyspark (PyPI). Vendors: Maven, PyPI.

Quick answers

Is CVE-2022-31777 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2022-31777 being exploited in the wild.
How severe is CVE-2022-31777?
Low severity, with a CVSS score of 3.1, published 1 November 2022.
Which products and versions are affected?
org.apache.spark:spark-core_2.10 (Maven) ECOSYSTEM:introduced=0; org.apache.spark:spark-core_2.11 (Maven) ECOSYSTEM:introduced=0; org.apache.spark:spark-core_2.12 (Maven) ECOSYSTEM:introduced=0,fixed=3.2.2; org.apache.spark:spark-core_2.13 (Maven) ECOSYSTEM:introduced=0,fixed=3.2.2; and 2 more.
Is there a fix for CVE-2022-31777?
Yes. org.apache.spark:spark-core_2.12 (Maven): upgrade to 3.2.2 or later; org.apache.spark:spark-core_2.13 (Maven): upgrade to 3.2.2 or later; pyspark (PyPI): upgrade to 3.2.2 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
Am I affected by CVE-2022-31777?
Check whether you run org.apache.spark:spark-core_2.10 (Maven), org.apache.spark:spark-core_2.11 (Maven), org.apache.spark:spark-core_2.12 (Maven) or one of the others listed at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • org.apache.spark:spark-core_2.12 (Maven): upgrade to 3.2.2 or later
    # set org.apache.spark:spark-core_2.12 to 3.2.2 in your pom.xml or build.gradle
  • org.apache.spark:spark-core_2.13 (Maven): upgrade to 3.2.2 or later
    # set org.apache.spark:spark-core_2.13 to 3.2.2 in your pom.xml or build.gradle
  • pyspark (PyPI): upgrade to 3.2.2 or later
    pip install "pyspark>=3.2.2"

Affected products

  • org.apache.spark:spark-core_2.10 (Maven) ECOSYSTEM:introduced=0
  • org.apache.spark:spark-core_2.11 (Maven) ECOSYSTEM:introduced=0
  • org.apache.spark:spark-core_2.12 (Maven) ECOSYSTEM:introduced=0,fixed=3.2.2
  • org.apache.spark:spark-core_2.13 (Maven) ECOSYSTEM:introduced=0,fixed=3.2.2
  • org.apache.spark:spark-core_2.9.3 (Maven) ECOSYSTEM:introduced=0
  • pyspark (PyPI) ECOSYSTEM:introduced=0,fixed=3.2.2

Identifiers

  • CVE-2022-31777
  • GHSA-43xg-8wmj-cw8h
  • PYSEC-2022-42976

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.