# CVE-2017-1000053: Arbitrary Code Execution in Cookie Serialization

> Attackers can execute arbitrary code via unsafe deserialization in Elixir Plug Session functions, requiring library upgrades.

- **Severity:** High 8.1 (`CVSS:3.1/AV:N/AC:H/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:** 13 Jul 2017
- **Updated:** 5 Aug 2024
- **Also known as:** GHSA-5v4m-c73v-c7gq

## What is CVE-2017-1000053?

CVE-2017-1000053 is a high-severity unsafe deserialization vulnerability in n/a, published on 13 Jul 2017. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

Elixir Plug before v1.0.4, v1.1.7, v1.2.3 and v1.3.2 is vulnerable to arbitrary code execution in the deserialization functions of Plug.Session.

Weakness: CWE-502 (Deserialization of Untrusted Data)

## Which versions are affected by CVE-2017-1000053?

8 open source packages ship an affected version, including plug. It affects 1 product.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `plug` | Hex | All versions | 1.0.4 |
| `plug` | Hex | All versions | 1.0.4 |
| `plug` | Hex | From 1.1.0 | 1.1.7 |
| `plug` | Hex | From 1.1.0 | 1.1.7 |
| `plug` | Hex | From 1.2.0 | 1.2.3 |
| `plug` | Hex | From 1.2.0 | 1.2.3 |
| `plug` | Hex | From 1.3.0 | 1.3.2 |
| `plug` | Hex | From 1.3.0 | 1.3.2 |

Products: Plug Project Plug.

## How do I fix CVE-2017-1000053?

Upgrade plug to a fixed version for your release line: 1.0.4, 1.1.7, 1.2.3 or 1.3.2.

## Is CVE-2017-1000053 being exploited?

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

## Other vulnerabilities in n/a

- [CVE-2017-1000052](https://insights.sbomify.com/CVE-2017-1000052/): Null Byte Injection in Plug.Static (high 7.8)
- [CVE-2018-1000883](https://insights.sbomify.com/CVE-2018-1000883/): Header Injection (medium 6.5)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2017-1000053 and fix it if it is affected.

What it is: CVE-2017-1000053 is a high-severity unsafe deserialization vulnerability in n/a, published on 13 Jul 2017. 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-2017-1000053 in the wild and no public exploit code.

Affected packages and fixed versions:
- plug (Hex): affected all versions; fixed in 1.0.4
- plug (Hex): affected all versions; fixed in 1.0.4
- plug (Hex): affected from 1.1.0; fixed in 1.1.7
- plug (Hex): affected from 1.1.0; fixed in 1.1.7
- plug (Hex): affected from 1.2.0; fixed in 1.2.3
- plug (Hex): affected from 1.2.0; fixed in 1.2.3
- plug (Hex): affected from 1.3.0; fixed in 1.3.2
- plug (Hex): affected from 1.3.0; fixed in 1.3.2

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-2017-1000053/ (Markdown: https://insights.sbomify.com/CVE-2017-1000053/index.md)
```

## Sources

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

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