CVE-2026-40968: Spring Framework Spring GRPC SecurityContext Leaks Across Vulnerability

MODERATE
Advisory Identifier: GHSA-4g9c-3x4p-mfpp
CVSS 4.2
CWE-653
Published
Advisory Summary

CVE-2026-40968 is a MODERATE (CVSS 4.2) spring grpc securitycontext leaks across vulnerability (CWE-653: Improper Isolation or Compartmentalization) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring grpc securitycontext leaks across requests upon authorization failure. Remediation is available by upgrading affected packages to version 1.0.3.

CVE-2026-40968 at a Glance

CVE Identifier CVE-2026-40968
GHSA Identifier GHSA-4g9c-3x4p-mfpp
Severity MODERATE
CVSS v3.1 Base Score 4.2
CWE Classification CWE-653: Improper Isolation or Compartmentalization
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 4.2

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

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

How to Fix CVE-2026-40968

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.grpc:spring-grpc fixed: 1.0.3
<dependency>
    <groupId>org.springframework.grpc</groupId>
    <artifactId>spring-grpc</artifactId>
    <version>1.0.3</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.grpc

How to Check if You Are Affected

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

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

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 1.0.3), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.springframework.grpc 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-653: Improper Isolation or Compartmentalization, where the product does not properly compartmentalize or isolate functionality, processes, or resources that require different privilege levels, rights, or permissions. 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

When an authenticated user is denied access to a gRPC method, their authenticated identity remains bound to the gRPC worker thread and can be inherited by a subsequent unauthenticated request on the same thread. This may allow the subsequent user to gain escalated permissions. Affected versions: Spring gRPC: 1.0.0 - 1.0.2 (fixed in 1.0.3). Older, unsupported versions are also affected.

CVE-2026-40968 Affected Spring Framework Versions

1 component(s)
Fixed Versions:
1.0.3
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework.grpc:spring-grpc
Maven
< 1.0.3
1.0.3

References

Frequently Asked Questions

What is CVE-2026-40968?
CVE-2026-40968 is a security vulnerability in Spring Framework involving Spring gRPC SecurityContext leaks across requests upon authorization failure under CWE-653: Improper Isolation or Compartmentalization.
Which Spring Framework versions are affected?
Affected versions include releases prior to 1.0.3 across affected packages: org.springframework.grpc:spring-grpc.
What version fixes CVE-2026-40968?
Upgrading to 1.0.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-grpc affected?
Yes, org.springframework.grpc:spring-grpc is affected in releases prior to 1.0.3. Upgrade your dependency to 1.0.3 or later.
What is the CVSS score of CVE-2026-40968?
CVE-2026-40968 has a CVSS v3.1 base score of 4.2 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N.
What CWE is associated with CVE-2026-40968?
CVE-2026-40968 is classified under CWE-653: Improper Isolation or Compartmentalization (The product does not properly compartmentalize or isolate functionality, processes, or resources that require different privilege levels, rights, or permissions.).
How can I check Maven dependencies for CVE-2026-40968?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework.grpc'. 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-4g9c-3x4p-mfpp",
  "modified" : "2026-05-06T19:59:34Z",
  "published" : "2026-04-28T15:30:51Z",
  "aliases" : [ "CVE-2026-40968" ],
  "summary" : "Spring gRPC SecurityContext leaks across requests upon authorization failure",
  "details" : "When an authenticated user is denied access to a gRPC method, their authenticated identity remains bound to the gRPC worker thread and can be inherited by a subsequent unauthenticated request on the same thread. This may allow the subsequent user to gain escalated permissions.\n\nAffected versions:\nSpring gRPC: 1.0.0 - 1.0.2 (fixed in 1.0.3). Older, unsupported versions are also affected.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:L/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework.grpc:spring-grpc"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-40968"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spring-projects/spring-grpc"
  }, {
    "type" : "WEB",
    "url" : "https://spring.io/security/cve-2026-40968"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-653" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-06T19:59:34Z",
    "nvd_published_at" : "2026-04-28T15:16:30Z"
  }
}