CVE-2011-2731: Spring Framework Remote Code Execution Vulnerability

MODERATE
Advisory Identifier: GHSA-4644-hg35-55m9
CWE-362
Published
Advisory Summary

CVE-2011-2731 is a MODERATE remote code execution vulnerability (CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')) affecting Spring Framework libraries in the Maven ecosystem. The issue involves concurrent execution using shared resource with improper synchronization in spring security. Remediation is available by upgrading affected packages to version 2.0.7, 3.0.6.

CVE-2011-2731 at a Glance

CVE Identifier CVE-2011-2731
GHSA Identifier GHSA-4644-hg35-55m9
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition')
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

How to Fix CVE-2011-2731

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-core fixed: 2.0.7
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>2.0.7</version>
</dependency>
org.springframework.security:spring-security-core fixed: 3.0.6
<dependency>
    <groupId>org.springframework.security</groupId>
    <artifactId>spring-security-core</artifactId>
    <version>3.0.6</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-2011-2731, 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 2.0.7), 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-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition'), where the product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently. 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

Race condition in the RunAsManager mechanism in VMware SpringSource Spring Security before 2.0.7 and 3.0.x before 3.0.6 stores the Authentication object in the shared security context, which allows attackers to gain privileges via a crafted thread.

CVE-2011-2731 Affected Spring Framework Versions

2 component(s)
Fixed Versions:
2.0.73.0.6
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework.security:spring-security-core
Maven
< 2.0.7
2.0.7
org.springframework.security:spring-security-core
Maven
≥ 3.0.0
< 3.0.6
3.0.6

References

Frequently Asked Questions

What is CVE-2011-2731?
CVE-2011-2731 is a security vulnerability in Spring Framework involving Concurrent Execution using Shared Resource with Improper Synchronization in Spring Security under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition').
Which Spring Framework versions are affected?
Affected versions include releases prior to 2.0.7, 3.0.6 across affected packages: org.springframework.security:spring-security-core.
What version fixes CVE-2011-2731?
Upgrading to 2.0.7, 3.0.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-security-core affected?
Yes, org.springframework.security:spring-security-core is affected in releases prior to 2.0.7, 3.0.6. Upgrade your dependency to 2.0.7, 3.0.6 or later.
What CWE is associated with CVE-2011-2731?
CVE-2011-2731 is classified under CWE-362: Concurrent Execution using Shared Resource with Improper Synchronization ('Race Condition') (The product contains a concurrent code sequence that requires temporary, exclusive access to a shared resource, but a timing window exists in which the shared resource can be modified by another code sequence operating concurrently.).
How can I check Maven dependencies for CVE-2011-2731?
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-4644-hg35-55m9",
  "modified" : "2022-07-13T17:46:37Z",
  "published" : "2022-05-17T04:59:50Z",
  "aliases" : [ "CVE-2011-2731" ],
  "summary" : "Concurrent Execution using Shared Resource with Improper Synchronization in Spring Security",
  "details" : "Race condition in the RunAsManager mechanism in VMware SpringSource Spring Security before 2.0.7 and 3.0.x before 3.0.6 stores the Authentication object in the shared security context, which allows attackers to gain privileges via a crafted thread.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.0.7"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.security:spring-security-core"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.0.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2011-2731"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spring-projects/spring-security"
  }, {
    "type" : "WEB",
    "url" : "http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=677814"
  }, {
    "type" : "WEB",
    "url" : "http://support.springsource.com/security/cve-2011-2731"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-362" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-07-13T17:46:37Z",
    "nvd_published_at" : "2012-12-05T17:55:00Z"
  }
}