<commit_before>---
title: Grails Framework Remote Code Execution Vulnerability
date: July 18, 2022
description: Grails Framework information regarding CVE-2022-35912
author: <NAME> and <NAME>
image: grails-blog-index-1.png
---

# [%title]

[%author]

[%date]

**[%description]**

The Grails team has confirmed a critical security vulnerability reported by meizjm3i and codeplutos of AntGroup FG Security Lab. This vulnerability has been assigned identifier [CVE-2022-35912](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-35912).

The vulnerability allows an attacker to remotely execute code within a Grails application runtime by issuing a specially crafted web request that grants the attacker access to the class loader. This attack exploits a section of the Grails data-binding logic.  Grails data-binding is invoked in a number of ways including the creation of command objects, domain class construction, and manual data binding when using `bindData`.  For a full description, please refer to [the data-binding documentation](https://docs.grails.org/latest/guide/theWebLayer.html#dataBinding).

## Impacted Applications

* Grails framework versions 3, 4, and 5
* Running on Java 8
* Using embedded Tomcat runtime, as well as those deployed to a Servlet Container

We have confirmed this vulnerability on Grails framework versions 3, 4, and 5 that are running on Java 8. The vulnerability has been observed in both the embedded Tomcat runtime and applications deployed as a war to a Tomcat instance.

Due to the nature of this vulnerability, we strongly suggest that all Grails applications, _including those running on Java 11 or higher_, be updated to a patched Grails release. While we have not been able to reproduce this specific exploit on applications running in Java 11, the nature of the vulnerability is such that variations on the attack could be discovered that impact later Java versions.

## Protecting Your Applications

The following Grails framework versions have been patched for this vulnerability:
* 5.2.1
* 5.1.9
* 4.1.1
* 3.3.15

The best way to protect your Grails applications is to upgrade to a patched release of the framework.

Grails 4.x applications can be upgraded to version 4.1.1 or higher, and Grails 5.0.x and 5.1.x applications can be upgraded to 5.1.9 or higher, and Grails 5.2 applications can be upgraded to 5.2.1 or higher.

For Grails 3 applications, we have released Grails framework 3.3.15, which includes a patch for this vulnerability (please note that Grails framework version 3 has reached end of support, and we strongly recommend that all Grails 3 applications be upgraded to an actively maintained version of the framework).

## Next Steps

The Grails Foundation and the Grails core development team take application security very seriously. We are continuing to research and monitor this vulnerability and will update this post with new information as it is discovered.<commit_msg>Updates to RCE blog post<commit_after>---
title: Grails Framework Remote Code Execution Vulnerability
date: July 18, 2022
description: Grails Framework information regarding CVE-2022-35912
author: <NAME> and <NAME>
image: grails-blog-index-1.png
---

# [%title]

[%author]

[%date]

**[%description]**


## Updates
### July 20th, 2022
Updated impacted Grails framework versions.

## Overview

The Grails team has confirmed a critical security vulnerability reported by meizjm3i and codeplutos of AntGroup FG Security Lab. This vulnerability has been assigned identifier [CVE-2022-35912](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2022-35912).

The vulnerability allows an attacker to remotely execute code within a Grails application runtime by issuing a specially crafted web request that grants the attacker access to the class loader. This attack exploits a section of the Grails data-binding logic.  Grails data-binding is invoked in a number of ways including the creation of command objects, domain class construction, and manual data binding when using `bindData`.  For a full description, please refer to [the data-binding documentation](https://docs.grails.org/latest/guide/theWebLayer.html#dataBinding).

## Impacted Applications

* Grails framework versions
  * &gt;= 3.3.10 &amp; &lt; 3.3.15
  * &gt;= 4.0.0 &amp; &lt; 4.1.1
  * &gt;= 5.0.0 &amp; &lt; 5.1.9
  * 5.2.0
* Running on Java 8
* Using embedded Tomcat runtime, as well as those deployed to a Servlet Container

We have confirmed this vulnerability on Grails framework versions 3.3.10 and higher (including Grails framework 4 and 5) that are running on Java 8. The vulnerability has been observed in both the embedded Tomcat runtime and applications deployed as a war to a Tomcat instance.

Due to the nature of this vulnerability, we strongly suggest that all Grails applications, _including those that are not vulnerable to this specific attack_, be updated to a patched Grails release. While we have not been able to reproduce this specific exploit on applications running in Java 11 or in versions of the Grails framework before 3.3.10, the nature of the vulnerability is such that variations on the attack could be discovered that earlier Grails releases, and Grails applications running on higher versions of Java, will be impacted.

## Protecting Your Applications

The following Grails framework versions have been patched for this vulnerability:
* 5.2.1
* 5.1.9
* 4.1.1
* 3.3.15

The best way to protect your Grails applications is to upgrade to a patched release of the framework.

Grails 4.x applications can be upgraded to version 4.1.1 or higher, and Grails 5.0.x and 5.1.x applications can be upgraded to 5.1.9 or higher, and Grails 5.2 applications can be upgraded to 5.2.1 or higher.

## Protecting Grails 3 Applications

For Grails 3 applications, we have released Grails framework 3.3.15, which includes a patch for this vulnerability (please note that Grails framework version 3 has reached end of support, and we strongly recommend that all Grails 3 applications be upgraded to an actively maintained version of the framework).

## Protecting Grails 2 Applications

As mentioned above, this specific attack is enabled by code added in version 3.3.10 of the Grails framework, so Grails framework version 2 applications are not vulnerable to it.  Due to the nature of the exploit, we strongly suggest that you upgrade your Grails applications to a patched and supported version of the framework.  Grails framework version 2 has reached end of support.

## Next Steps

The Grails Foundation and the Grails core development team take application security very seriously. We are continuing to research and monitor this vulnerability and will update this post with new information as it is discovered.
{'fraction_non_alphanumeric': 0.05401394865707078, 'fraction_numerical': 0.030419943611811842, 'mean_word_length': 4.561056105610561, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1066188', 'n_tokens_mistral': 1874, 'n_tokens_neox': 1676, 'n_words': 957}