{"answers":{"affected":"20 open source packages ship an affected version, including org.apache.spark:spark-core_2.12, spark and org.apache.spark:spark-core_2.10. It affects 1 product.","exploited":"There is no known exploitation of CVE-2022-31777 in the wild and no public exploit code.","fix":"Upgrade org.apache.spark:spark-core_2.12 to a fixed version for your release line: 3.2.2 or 3.3.1.","what":"CVE-2022-31777 is a medium-severity cross-site scripting vulnerability in Apache Spark, published on 1 Nov 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link."},"fix_prompt":"Check this codebase for CVE-2022-31777 and fix it if it is affected.\n\nWhat it is: CVE-2022-31777 is a medium-severity cross-site scripting vulnerability in Apache Spark, published on 1 Nov 2022. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.\nExploitation: There is no known exploitation of CVE-2022-31777 in the wild and no public exploit code.\n\nAffected packages and fixed versions:\n- org.apache.spark:spark-core_2.12 (Maven): affected all versions; fixed in 3.2.2\n- org.apache.spark:spark-core_2.12 (Maven): affected all versions; fixed in 3.2.2\n- org.apache.spark:spark-core_2.12 (Maven): affected from 3.3.0; fixed in 3.3.1\n- org.apache.spark:spark-core_2.12 (Maven): affected from 3.3.0; fixed in 3.3.1\n- spark (Bitnami): affected all versions; fixed in 3.2.2, 3.3.1\n- org.apache.spark:spark-core_2.10 (Maven): affected all versions; no fix listed\n- org.apache.spark:spark-core_2.10 (Maven): affected all versions; no fix listed\n- org.apache.spark:spark-core_2.11 (Maven): affected all versions; no fix listed\n- org.apache.spark:spark-core_2.11 (Maven): affected all versions; no fix listed\n- org.apache.spark:spark-core_2.13 (Maven): affected all versions; fixed in 3.2.2\n- org.apache.spark:spark-core_2.13 (Maven): affected all versions; fixed in 3.2.2\n- org.apache.spark:spark-core_2.13 (Maven): affected from 3.3.0; fixed in 3.3.1\n\nTask:\n1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.\n2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.\n3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.\n4. Run the tests and summarise what changed and why.\n5. If nothing in the project is affected, say so and change nothing.\n\nReference: https://insights.sbomify.com/CVE-2022-31777/ (Markdown: https://insights.sbomify.com/CVE-2022-31777/index.md)","id":"CVE-2022-31777","markdown":"https://insights.sbomify.com/CVE-2022-31777/index.md","name":"CVE-2022-31777","record":{"aliases":["BIT-spark-2022-31777","GHSA-43xg-8wmj-cw8h","PYSEC-2022-42976"],"analysis":{"component_type":"server_software","fix_type":"upgrade","impacts":["code_execution"],"network_reachable":"yes","non_default_config":false,"product_category":"Apache Spark","requires_auth":"low_privilege","summary":"Remote attackers can execute arbitrary JavaScript in user browsers via stored XSS in the Apache Spark log viewer UI.","user_interaction":"required","vuln_class":"xss"},"analysis_generated_by":"qwen3.8-flash-next","assigner":"apache","cpe":[{"product":"spark","vendor":"apache"}],"cvss":{"score":5.4,"severity":"medium","source":"cisa-adp","vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N","version":"3.1"},"cwes":[{"id":"CWE-74","name":"Improper Neutralization of Special Elements in Output Used by a Downstream Component"}],"description":"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.","ecosystems":["Bitnami","Maven","PyPI"],"exploits":{"exploitdb":0,"first_seen":null,"github_poc":0,"max_poc_stars":null,"metasploit":0,"nuclei":0,"refs":[],"tier":"none_known"},"has_fix":true,"headline":"Apache Spark XSS vulnerability in log viewer UI Javascript","id":"CVE-2022-31777","indexable":true,"kev":null,"kind":"cve","links":{"ecosystem":"Bitnami","product":null,"products":[],"type":"xss","year":"2022"},"n_packages":20,"n_references":2,"next":{"headline":"Transfer-Encoding not treated as hop-by-hop","id":"CVE-2022-31778"},"packages":[{"ecosystem":"Bitnami","fixed":["3.2.2","3.3.1"],"introduced":["0","3.3.0"],"last_affected":[],"package":"spark","purl":"pkg:bitnami/spark","source":"BIT-spark-2022-31777"},{"ecosystem":"Maven","fixed":[],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.10","purl":null,"source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":[],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.10","purl":"pkg:maven/org.apache.spark/spark-core_2.10","source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":[],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.11","purl":null,"source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":[],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.11","purl":"pkg:maven/org.apache.spark/spark-core_2.11","source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":["3.2.2"],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.12","purl":null,"source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":["3.2.2"],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.12","purl":"pkg:maven/org.apache.spark/spark-core_2.12","source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":["3.3.1"],"introduced":["3.3.0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.12","purl":null,"source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":["3.3.1"],"introduced":["3.3.0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.12","purl":"pkg:maven/org.apache.spark/spark-core_2.12","source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":["3.2.2"],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.13","purl":null,"source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":["3.2.2"],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.13","purl":"pkg:maven/org.apache.spark/spark-core_2.13","source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":["3.3.1"],"introduced":["3.3.0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.13","purl":null,"source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":["3.3.1"],"introduced":["3.3.0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.13","purl":"pkg:maven/org.apache.spark/spark-core_2.13","source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":[],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.9.3","purl":null,"source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"Maven","fixed":[],"introduced":["0"],"last_affected":[],"package":"org.apache.spark:spark-core_2.9.3","purl":"pkg:maven/org.apache.spark/spark-core_2.9.3","source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"PyPI","fixed":["3.2.2"],"introduced":["0"],"last_affected":[],"package":"pyspark","purl":null,"source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"PyPI","fixed":["3.2.2"],"introduced":["0"],"last_affected":[],"package":"pyspark","purl":"pkg:pypi/pyspark","source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"PyPI","fixed":["3.2.2"],"introduced":["0"],"last_affected":[],"package":"pyspark","purl":"pkg:pypi/pyspark","source":"PYSEC-2022-42976"},{"ecosystem":"PyPI","fixed":["3.3.1"],"introduced":["3.3.0"],"last_affected":[],"package":"pyspark","purl":null,"source":"GHSA-43xg-8wmj-cw8h"},{"ecosystem":"PyPI","fixed":["3.3.1"],"introduced":["3.3.0"],"last_affected":[],"package":"pyspark","purl":"pkg:pypi/pyspark","source":"GHSA-43xg-8wmj-cw8h"}],"prev":{"headline":"Server-side request forgery in DataPower Gateway","id":"CVE-2022-31776"},"products":["Apache Spark"],"published":"2022-11-01","related":[{"cvss_score":8.8,"headline":"Apache Spark Command Injection","id":"CVE-2022-33891","kev_date_added":"2023-03-07","published":"2022-07-18"},{"cvss_score":9.8,"headline":"Improper Authentication in Apache Spark","id":"CVE-2020-9480","kev_date_added":null,"published":"2020-06-23"},{"cvss_score":9.8,"headline":"Remote Code Execution in spark-core","id":"CVE-2018-17190","kev_date_added":null,"published":"2018-11-19"},{"cvss_score":9.1,"headline":"HTTP Request Smuggling in Netty","id":"CVE-2019-20445","kev_date_added":null,"published":"2020-01-29"},{"cvss_score":8.8,"headline":"Apache Spark: Spark History Server Code Execution Vulnerability","id":"CVE-2025-54920","kev_date_added":null,"published":"2026-03-14"},{"cvss_score":8.8,"headline":"Apache Spark: Shell command injection via Spark UI","id":"CVE-2023-32007","kev_date_added":null,"published":"2023-05-02"},{"cvss_score":7.8,"headline":"Apache Spark Deserialization of Untrusted Data vulnerability","id":"CVE-2017-12612","kev_date_added":null,"published":"2017-09-13"}],"sources":[{"class":"attribution","licence":"Apache-2.0","name":"Bitnami","prefix":"BIT"},{"class":"attribution","licence":"CVE Terms of Use (MITRE)","name":"CVE List","prefix":"CVE"},{"class":"attribution","licence":"CC BY 4.0","name":"GitHub Advisory Database","prefix":"GHSA"},{"class":"attribution","licence":"CC BY 4.0","name":"PyPA Advisory Database","prefix":"PYSEC"},{"class":"attribution","licence":"US public information, NVD API terms","name":"NVD"},{"class":"attribution","licence":"CWE Terms of Use","name":"CWE (MITRE)"},{"class":"attribution","licence":"FIRST CVSS licence","name":"CVSS (FIRST)"}],"ssvc":{"automatable":"no","exploitation":"none","technical_impact":"partial"},"state":"PUBLISHED","updated":"2025-05-06","vendors":["Apache Software Foundation"]},"summary":"Remote attackers can execute arbitrary JavaScript in user browsers via stored XSS in the Apache Spark log viewer UI.","url":"https://insights.sbomify.com/CVE-2022-31777/"}