CVE-2023-34042: Spring Framework Spring Security's Spring-security.xsd File Is Vulnerability

MODERATE
Advisory Identifier: GHSA-9gp8-6cg8-7h34
CVSS 5.5
CWE-732
Published
Advisory Summary

CVE-2023-34042 is a MODERATE (CVSS 5.5) spring security's spring-security.xsd file is vulnerability (CWE-732: Incorrect Permission Assignment for Critical Resource) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring security's spring-security.xsd file is world writable. Remediation is available by upgrading affected packages to version 6.1.4, 6.0.7, 5.8.7, 5.7.11.

CVE-2023-34042 at a Glance

CVE Identifier CVE-2023-34042
GHSA Identifier GHSA-9gp8-6cg8-7h34
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-732: Incorrect Permission Assignment for Critical Resource
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.5

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

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

How to Fix CVE-2023-34042

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

org.springframework.security:spring-security-config fixed: 6.1.4
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-config</artifactId>
    <version>6.1.4</version>
</dependency>
org.springframework.security:spring-security-config fixed: 6.0.7
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-config</artifactId>
    <version>6.0.7</version>
</dependency>
org.springframework.security:spring-security-config fixed: 5.8.7
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-config</artifactId>
    <version>5.8.7</version>
</dependency>
org.springframework.security:spring-security-config fixed: 5.7.11
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-config</artifactId>
    <version>5.7.11</version>
</dependency>
Verify Direct and Transitive Dependencies

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

mvn dependency:tree -Dincludes=org.springframework.security

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2023-34042, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.springframework.security

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

Note: The mvn dependency:tree -Dincludes=org.springframework.security command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-732: Incorrect Permission Assignment for Critical Resource, where the product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors. In Spring Framework, 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

The spring-security.xsd file inside the spring-security-config jar is world writable which means that if it were extracted it could be written by anyone with access to the file system. While there are no known exploits, this is an example of “CWE-732: Incorrect Permission Assignment for Critical Resource” and could result in an exploit. Users should update to the latest version of Spring Security to mitigate any future exploits found around this issue.

CVE-2023-34042 Affected Spring Framework Versions

4 component(s)
Fixed Versions:
6.1.46.0.75.8.75.7.11
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework.security:spring-security-config
Maven
≥ 6.1.1
< 6.1.4
6.1.4
org.springframework.security:spring-security-config
Maven
≥ 6.0.4
< 6.0.7
6.0.7
org.springframework.security:spring-security-config
Maven
≥ 5.8.4
< 5.8.7
5.8.7
org.springframework.security:spring-security-config
Maven
≥ 5.7.9
< 5.7.11
5.7.11

References

Frequently Asked Questions

What is CVE-2023-34042?
CVE-2023-34042 is a security vulnerability in Spring Framework involving Spring Security's spring-security.xsd file is world writable under CWE-732: Incorrect Permission Assignment for Critical Resource.
Which Spring Framework versions are affected?
Affected versions include releases prior to 6.1.4, 6.0.7, 5.8.7, 5.7.11 across affected packages: org.springframework.security:spring-security-config.
What version fixes CVE-2023-34042?
Upgrading to 6.1.4, 6.0.7, 5.8.7, 5.7.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-security-config affected?
Yes, org.springframework.security:spring-security-config is affected in releases prior to 6.1.4, 6.0.7, 5.8.7, 5.7.11. Upgrade your dependency to 6.1.4, 6.0.7, 5.8.7, 5.7.11 or later.
What is the CVSS score of CVE-2023-34042?
CVE-2023-34042 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2023-34042?
CVE-2023-34042 is classified under CWE-732: Incorrect Permission Assignment for Critical Resource (The product specifies permissions for a security-critical resource in a way that allows that resource to be read or modified by unintended actors.).
How can I check Maven dependencies for CVE-2023-34042?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework.security'. 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-9gp8-6cg8-7h34",
  "modified" : "2024-11-29T12:31:48Z",
  "published" : "2024-02-06T00:30:25Z",
  "aliases" : [ "CVE-2023-34042" ],
  "summary" : "Spring Security's spring-security.xsd file is world writable",
  "details" : "The spring-security.xsd file inside the spring-security-config jar is world writable which means that if it were extracted it could be written by anyone with access to the file system.\n\nWhile there are no known exploits, this is an example of “CWE-732: Incorrect Permission Assignment for Critical Resource” and could result in an exploit. Users should update to the latest version of Spring Security to mitigate any future exploits found around this issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-config"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.1.1"
      }, {
        "fixed" : "6.1.4"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.1.3"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-config"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "6.0.4"
      }, {
        "fixed" : "6.0.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 6.0.6"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-config"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.8.4"
      }, {
        "fixed" : "5.8.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.8.6"
    }
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-config"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.7.9"
      }, {
        "fixed" : "5.7.11"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 5.7.10"
    }
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-34042"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-projects/spring-security/commit/5b293d21161e946bf241d9e974b9af93cfafaaac"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spring-projects/spring-security"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20241129-0010"
  }, {
    "type" : "WEB",
    "url" : "https://spring.io/security/cve-2023-34042"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-732" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-06T15:52:33Z",
    "nvd_published_at" : "2024-02-05T22:15:55Z"
  }
}