# CVE-2021-38296: PYSEC-2022-186 - Apache Spark supports end-to-end encryption of RPC connections via "spark.authenticate" and "spark.network.crypto.enabled". In versions 3.1.

Source: https://junglewise.ai/threats/cve-2021-38296-authentication-bypass-by-capture-replay-in-apache-spark  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2022-03-10  
License: CC BY 4.0 with a link back

CVE-2021-38296 · Severity: low · CVSS 3.1 · Published 2022-03-10

Apache Spark supports end-to-end encryption of RPC connections via "spark.authenticate" and "spark.network.crypto.enabled". In versions 3.1.2 and earlier, it uses a bespoke mutual authentication protocol that allows for full encryption key recovery. After an initial interactive attack, this would allow someone to decrypt plaintext traffic offline. Note that this does not affect security mechanisms controlled by "spark.authenticate.enableSaslEncryption", "spark.io.encryption.enabled", "spark.ssl", "spark.ui.strictTransportSecurity". Update to Apache Spark 3.1.3 or later

Technologies: [pyspark (PyPI)](https://junglewise.ai/threats/technologies/pyspark). Vendors: [Maven](https://junglewise.ai/threats/vendors/maven), [PyPI](https://junglewise.ai/threats/vendors/pypi).

## Quick answers

**Is CVE-2021-38296 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-38296 being exploited in the wild.

**How severe is CVE-2021-38296?** Low severity, with a CVSS score of 3.1, published 10 March 2022.

**Which products and versions are affected?** org.apache.spark:spark-core (Maven) ECOSYSTEM:introduced=0,fixed=3.1.3; pyspark (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.3.

**Is there a fix for CVE-2021-38296?** Yes. org.apache.spark:spark-core (Maven): upgrade to 3.1.3 or later; pyspark (PyPI): upgrade to 3.1.3 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**Am I affected by CVE-2021-38296?** Check whether you run org.apache.spark:spark-core (Maven) or pyspark (PyPI) 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 (Maven): upgrade to 3.1.3 or later

  ```sh
  # set org.apache.spark:spark-core to 3.1.3 in your pom.xml or build.gradle
  ```

- pyspark (PyPI): upgrade to 3.1.3 or later

  ```sh
  pip install "pyspark>=3.1.3"
  ```


## Affected products

- org.apache.spark:spark-core (Maven) ECOSYSTEM:introduced=0,fixed=3.1.3
- pyspark (PyPI) ECOSYSTEM:introduced=0,fixed=3.1.3

## Identifiers

- CVE-2021-38296
- GHSA-9rr6-jpg7-9jg6
- PYSEC-2022-186

## Related threats

- [Apache Spark History Server XSS in job names](https://junglewise.ai/threats/cve-2026-32773-apache-spark-history-server-xss-in-job-names)
- [Apache Spark Inadequate Encryption Strength in RPC Communication](https://junglewise.ai/threats/cve-2025-55039-apache-spark-inadequate-encryption-strength-in-rpc-communication)
- [Apache Spark UI vulnerable to Command Injection](https://junglewise.ai/threats/cve-2023-32007-apache-spark-ui-vulnerable-to-command-injection)
- [Apache Spark privilege escalation via classpath injection](https://junglewise.ai/threats/cve-2023-22946-apache-spark-privilege-escalation-via-classpath-injection)
- [Apache Spark vulnerable to Log Injection](https://junglewise.ai/threats/cve-2022-31777-apache-spark-vulnerable-to-log-injection)
