# CVE-2016-6814: Deserialization of Untrusted Data in Groovy

> Attackers can execute arbitrary code by sending specially crafted serialized objects to applications using vulnerable Groovy versions.

- **Severity:** Critical 9.8 (`CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`)
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** Not needed
- **Fix available:** Yes
- **Published:** 18 Jan 2018
- **Updated:** 16 Sep 2024
- **Also known as:** DEBIAN-CVE-2016-6814, DLA-794-1, GHSA-xphj-m9cc-8fmq, MGASA-2017-0311, UBUNTU-CVE-2016-6814, USN-4795-1

## What is CVE-2016-6814?

CVE-2016-6814 is a critical unsafe deserialization vulnerability in Redhat Enterprise Linux Server, published on 18 Jan 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

When an application with unsupported Codehaus versions of Groovy from 1.7.0 to 2.4.3, Apache Groovy 2.4.4 to 2.4.7 on classpath uses standard Java serialization mechanisms, e.g. to communicate between servers or to store local data, it was possible for an attacker to bake a special serialized object that will execute code directly when deserialized. All applications which rely on serialization and do not isolate the code which deserializes objects were subject to this vulnerability.

Weakness: CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2016-6814?

4 open source packages ship an affected version, including org.codehaus.groovy:groovy and org.codehaus.groovy:groovy-all. It affects 2 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.codehaus.groovy:groovy` | Maven | From 1.7.0 | 2.4.8 |
| `org.codehaus.groovy:groovy` | Maven | From 1.7.0 | 2.4.8 |
| `org.codehaus.groovy:groovy-all` | Maven | From 1.7.0 | 2.4.8 |
| `org.codehaus.groovy:groovy-all` | Maven | From 1.7.0 | 2.4.8 |

Products: Apache Groovy, Redhat Enterprise Linux Server.

## How do I fix CVE-2016-6814?

Upgrade org.codehaus.groovy:groovy to 2.4.8 or later.

## Is CVE-2016-6814 being exploited?

There is no known exploitation of CVE-2016-6814 in the wild and no public exploit code.

## Other vulnerabilities in Redhat Enterprise Linux Server

- [CVE-2015-3253](https://insights.sbomify.com/CVE-2015-3253/): Improper Neutralization of Special Elements in Output Used by a Downstream Component in Apache Groovy (critical 9.8)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2016-6814 and fix it if it is affected.

What it is: CVE-2016-6814 is a critical unsafe deserialization vulnerability in Redhat Enterprise Linux Server, published on 18 Jan 2018. An attacker can exploit it over the internet without logging in, with no action from the victim.
Exploitation: There is no known exploitation of CVE-2016-6814 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.codehaus.groovy:groovy (Maven): affected from 1.7.0; fixed in 2.4.8
- org.codehaus.groovy:groovy (Maven): affected from 1.7.0; fixed in 2.4.8
- org.codehaus.groovy:groovy-all (Maven): affected from 1.7.0; fixed in 2.4.8
- org.codehaus.groovy:groovy-all (Maven): affected from 1.7.0; fixed in 2.4.8

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2016-6814/ (Markdown: https://insights.sbomify.com/CVE-2016-6814/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2016-6814
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2016-6814
- OSV: https://osv.dev/vulnerability/CVE-2016-6814

---
From sbomify Insights: https://insights.sbomify.com/CVE-2016-6814/
Summaries are generated and may contain mistakes; the official description above is the record.
