Vulnerabilities in pkg:maven/com.baomidou/dynamic-datasource-spring

PACKAGE
Advisory Identifier: GHSA-6rmm-pg23-5f8q
Advisory Summary

CVE-2026-7045 is a MODERATE (CVSS 6.3) remote code execution vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Spring Framework libraries in the Maven ecosystem. The issue involves dynamic-datasource has an injection vulnerability. Remediation is available in the latest vendor maintenance releases.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/com.baomidou/dynamic-datasource-spring

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/com.baomidou/dynamic-datasource-spring. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6rmm-pg23-5f8q CVE-2026-7045 MODERATE Dynamic-Datasource has an Injection vulnerability

CVE-2026-7045 at a Glance

CVE Identifier CVE-2026-7045
GHSA Identifier GHSA-6rmm-pg23-5f8q
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 6.3

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

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

How to Fix CVE-2026-7045

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.

com.baomidou:dynamic-datasource-spring fixed: Latest secure release
<dependency>
    <groupId>com.baomidou</groupId>
    <artifactId>dynamic-datasource-spring</artifactId>
    <version>Latest secure release</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=com.baomidou

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=com.baomidou

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 the patched release), your application is affected.

Note: The mvn dependency:tree -Dincludes=com.baomidou 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-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. 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

A vulnerability was determined in baomidou dynamic-datasource 2.5.0. Affected by this vulnerability is the function DsSpelExpressionProcessor#doDetermineDatasource of the file dynamic-datasource-spring/src/main/java/com/baomidou/dynamic/datasource/processor/DsSpelExpressionProcessor.java of the component StandardEvaluationContext/SpelExpressionParser. This manipulation causes injection. The attack may be initiated remotely. Patch name: 273fcedaee984c08197c0890f14190b86ab7e0b8. It is recommended to apply a patch to fix this issue.

CVE-2026-7045 Affected Spring Framework Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
com.baomidou:dynamic-datasource-spring
Maven
≤ 4.5.0

References

Frequently Asked Questions

What is CVE-2026-7045?
CVE-2026-7045 is a security vulnerability in Spring Framework involving Dynamic-Datasource has an Injection vulnerability under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Spring Framework versions are affected?
Affected versions include releases prior to current release patches across affected packages: com.baomidou:dynamic-datasource-spring.
What version fixes CVE-2026-7045?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is dynamic-datasource-spring affected?
Yes, com.baomidou:dynamic-datasource-spring is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2026-7045?
CVE-2026-7045 has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with CVE-2026-7045?
CVE-2026-7045 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check Maven dependencies for CVE-2026-7045?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.baomidou'. 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-6rmm-pg23-5f8q",
  "modified" : "2026-05-05T21:13:27Z",
  "published" : "2026-04-27T00:30:27Z",
  "aliases" : [ "CVE-2026-7045" ],
  "summary" : "Dynamic-Datasource has an Injection vulnerability",
  "details" : "A vulnerability was determined in baomidou dynamic-datasource 2.5.0. Affected by this vulnerability is the function DsSpelExpressionProcessor#doDetermineDatasource of the file dynamic-datasource-spring/src/main/java/com/baomidou/dynamic/datasource/processor/DsSpelExpressionProcessor.java of the component StandardEvaluationContext/SpelExpressionParser. This manipulation causes injection. The attack may be initiated remotely. Patch name: 273fcedaee984c08197c0890f14190b86ab7e0b8. It is recommended to apply a patch to fix this issue.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "com.baomidou:dynamic-datasource-spring"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "4.5.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-7045"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/baomidou/dynamic-datasource/issues/766"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/baomidou/dynamic-datasource/pull/767"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/baomidou/dynamic-datasource/commit/273fcedaee984c08197c0890f14190b86ab7e0b8"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/baomidou/dynamic-datasource"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/submit/798600"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/vuln/359624"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/vuln/359624/cti"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-05-05T21:13:27Z",
    "nvd_published_at" : "2026-04-26T22:17:32Z"
  }
}