CVE-2018-1270: Spring Framework Spring Framework Allows Applications To Vulnerability

CRITICAL
Advisory Identifier: GHSA-p5hg-3xm3-gcjg
CVSS 9.8
CWE-94 CWE-358
Published
Advisory Summary

CVE-2018-1270 is a CRITICAL (CVSS 9.8) spring framework allows applications to vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Spring Framework libraries in the Maven ecosystem. The issue involves spring framework allows applications to expose stomp over websocket endpoints. Remediation is available by upgrading affected packages to version 5.0.5.RELEASE, 4.3.16.RELEASE.

CVE-2018-1270 at a Glance

CVE Identifier CVE-2018-1270
GHSA Identifier GHSA-p5hg-3xm3-gcjg
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Spring Framework
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 9.8

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

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

How to Fix CVE-2018-1270

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:spring-messaging fixed: 5.0.5.RELEASE
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-messaging</artifactId>
    <version>5.0.5.RELEASE</version>
</dependency>
org.springframework:spring-messaging fixed: 4.3.16.RELEASE
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-messaging</artifactId>
    <version>4.3.16.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=org.springframework

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=org.springframework

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

Note: The mvn dependency:tree -Dincludes=org.springframework 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-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. 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

Spring Framework, versions 5.0 prior to 5.0.5 and versions 4.3 prior to 4.3.16 and older unsupported versions, allow applications to expose STOMP over WebSocket endpoints with a simple, in-memory STOMP broker through the spring-messaging module. A malicious user (or attacker) can craft a message to the broker that can lead to a remote code execution attack.

CVE-2018-1270 Affected Spring Framework Versions

2 component(s)
Fixed Versions:
5.0.5.RELEASE4.3.16.RELEASE
Product / Package Ecosystem Affected Versions Fixed Version
org.springframework:spring-messaging
Maven
≥ 5.0.0.RELEASE
< 5.0.5.RELEASE
5.0.5.RELEASE
org.springframework:spring-messaging
Maven
< 4.3.16.RELEASE
4.3.16.RELEASE

References

NVD — CVE-2018-1270 NVD
https://nvd.nist.gov/vuln/detail/CVE-2018-1270
Security Fix Commit FIX COMMIT
https://github.com/spring-projects/spring-framework/commit/0009806debb578e884f6dc98bd1f2dc668020021
Security Fix Commit FIX COMMIT
https://github.com/spring-projects/spring-framework/commit/e0de9126ed8cf25cf141d3e66420da94e350708a
Spring Framework Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html
Spring Framework Security Information SECURITY
https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html
Spring Framework Security Information SECURITY
https://www.oracle.com/security-alerts/cpuoct2021.html
Spring Framework Security Information SECURITY
https://www.oracle.com/security-alerts/cpujul2020.html
www.exploit-db.com/exploits/44796 WEB
https://www.exploit-db.com/exploits/44796
Spring Framework Security Information SECURITY
https://web.archive.org/web/20200227125035/https://www.securityfocus.com/bid/103696
Spring Framework Security Information SECURITY
https://pivotal.io/security/cve-2018-1270
lists.debian.org/debian-lts-announce... WEB
https://lists.debian.org/debian-lts-announce/2021/04/msg00022.html
lists.apache.org/thread.html/rf1bbc0... WEB
https://lists.apache.org/thread.html/rf1bbc0ea4a9f014cf94df9a12a6477d24a27f52741dbc87f2fd52ff2@%3Cissues.geode.apache.org%3E
lists.apache.org/thread.html/dcf8599... WEB
https://lists.apache.org/thread.html/dcf8599b80e43a6b60482607adb76c64672772dc2d9209ae2170f369@%3Cissues.activemq.apache.org%3E
lists.apache.org/thread.html/ab825fc... WEB
https://lists.apache.org/thread.html/ab825fcade0b49becfa30235b3d54f4a51bb74ea96b6c9adb5d1378c@%3Cissues.activemq.apache.org%3E
lists.apache.org/thread.html/6d3d34a... WEB
https://lists.apache.org/thread.html/6d3d34adcf3dfc48e36342aa1f18ce3c20bb8e4c458a97508d5bfed1@%3Cissues.activemq.apache.org%3E
lists.apache.org/thread.html/4ed49b1... WEB
https://lists.apache.org/thread.html/4ed49b103f64a0cecb38064f26cbf1389afc12124653da2d35166dbe@%3Cissues.activemq.apache.org%3E
Spring Framework Source Repository REPOSITORY
https://github.com/spring-projects/spring-framework
access.redhat.com/errata/rhsa-2018:29... WEB
https://access.redhat.com/errata/RHSA-2018:2939
Spring Framework Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html
Spring Framework Security Information SECURITY
http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html

Frequently Asked Questions

What is CVE-2018-1270?
CVE-2018-1270 is a security vulnerability in Spring Framework involving Spring Framework allows applications to expose STOMP over WebSocket endpoints under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Spring Framework versions are affected?
Affected versions include releases prior to 5.0.5.RELEASE, 4.3.16.RELEASE across affected packages: org.springframework:spring-messaging.
What version fixes CVE-2018-1270?
Upgrading to 5.0.5.RELEASE, 4.3.16.RELEASE (or the latest patched release for your respective branch) resolves the vulnerability.
Is spring-messaging affected?
Yes, org.springframework:spring-messaging is affected in releases prior to 5.0.5.RELEASE, 4.3.16.RELEASE. Upgrade your dependency to 5.0.5.RELEASE, 4.3.16.RELEASE or later.
What is the CVSS score of CVE-2018-1270?
CVE-2018-1270 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-1270?
CVE-2018-1270 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check Maven dependencies for CVE-2018-1270?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.springframework'. 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-p5hg-3xm3-gcjg",
  "modified" : "2025-01-31T18:51:12Z",
  "published" : "2018-10-17T20:05:59Z",
  "aliases" : [ "CVE-2018-1270" ],
  "summary" : "Spring Framework allows applications to expose STOMP over WebSocket endpoints",
  "details" : "Spring Framework, versions 5.0 prior to 5.0.5 and versions 4.3 prior to 4.3.16 and older unsupported versions, allow applications to expose STOMP over WebSocket endpoints with a simple, in-memory STOMP broker through the spring-messaging module. A malicious user (or attacker) can craft a message to the broker that can lead to a remote code execution attack.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework:spring-messaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "5.0.0.RELEASE"
      }, {
        "fixed" : "5.0.5.RELEASE"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.springframework:spring-messaging"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.3.16.RELEASE"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-1270"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-projects/spring-framework/commit/0009806debb578e884f6dc98bd1f2dc668020021"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/spring-projects/spring-framework/commit/e0de9126ed8cf25cf141d3e66420da94e350708a"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpujul2019-5072835.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/technetwork/security-advisory/cpujan2019-5072801.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpuoct2021.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.oracle.com/security-alerts/cpujul2020.html"
  }, {
    "type" : "WEB",
    "url" : "https://www.exploit-db.com/exploits/44796"
  }, {
    "type" : "WEB",
    "url" : "https://web.archive.org/web/20200227125035/https://www.securityfocus.com/bid/103696"
  }, {
    "type" : "WEB",
    "url" : "https://pivotal.io/security/cve-2018-1270"
  }, {
    "type" : "WEB",
    "url" : "https://lists.debian.org/debian-lts-announce/2021/04/msg00022.html"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/rf1bbc0ea4a9f014cf94df9a12a6477d24a27f52741dbc87f2fd52ff2@%3Cissues.geode.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/dcf8599b80e43a6b60482607adb76c64672772dc2d9209ae2170f369@%3Cissues.activemq.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/ab825fcade0b49becfa30235b3d54f4a51bb74ea96b6c9adb5d1378c@%3Cissues.activemq.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/6d3d34adcf3dfc48e36342aa1f18ce3c20bb8e4c458a97508d5bfed1@%3Cissues.activemq.apache.org%3E"
  }, {
    "type" : "WEB",
    "url" : "https://lists.apache.org/thread.html/4ed49b103f64a0cecb38064f26cbf1389afc12124653da2d35166dbe@%3Cissues.activemq.apache.org%3E"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/spring-projects/spring-framework"
  }, {
    "type" : "WEB",
    "url" : "https://access.redhat.com/errata/RHSA-2018:2939"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpujul2018-4258247.html"
  }, {
    "type" : "WEB",
    "url" : "http://www.oracle.com/technetwork/security-advisory/cpuoct2018-4428296.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-358", "CWE-94" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-16T21:47:59Z",
    "nvd_published_at" : "2018-04-06T13:29:00Z"
  }
}