# CVE-2016-2510: Improper Input Validation in BeanShell

> Remote attackers can execute arbitrary code via crafted serialized data in applications using BeanShell with Java serialization or XStream.

- **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:** 7 Apr 2016
- **Updated:** 5 Aug 2024
- **Also known as:** DEBIAN-CVE-2016-2510, DLA-443-1, DSA-3504-1, GHSA-gxg6-rc6c-v673, SUSE-SU-2016:0699-1, SUSE-SU-2016:0700-1, UBUNTU-CVE-2016-2510, USN-2923-1, openSUSE-SU-2024:10420-1

## What is CVE-2016-2510?

CVE-2016-2510 is a high-severity unsafe deserialization vulnerability in Canonical Ubuntu Linux, published on 7 Apr 2016. An attacker can exploit it over the internet without logging in, with no action from the victim.

### Official description

BeanShell (bsh) before 2.0b6, when included on the classpath by an application that uses Java serialization or XStream, allows remote attackers to execute arbitrary code via crafted serialized data, related to XThis.Handler.

Weakness: CWE-19

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

2 open source packages ship an affected version, including org.apache-extras.beanshell:bsh. It affects 3 products.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `org.apache-extras.beanshell:bsh` | Maven | All versions | 2.0b6 |
| `org.apache-extras.beanshell:bsh` | Maven | All versions | 2.0b6 |
| `bsh2` | SUSE:Linux Enterprise Software Development Kit 11 SP4 | All versions | 2.0-318.1 |
| `bsh2` | SUSE:Linux Enterprise Software Development Kit 12 | All versions | 2.0.0.b5-3.2 |
| `bsh2` | SUSE:Linux Enterprise Software Development Kit 12 SP1 | All versions | 2.0.0.b5-3.2 |
| `bsh2` | openSUSE:Tumbleweed | All versions | 2.0.0.b6-2.7 |

Products: Beanshell Beanshell, Canonical Ubuntu Linux, Debian Debian Linux.

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

Upgrade org.apache-extras.beanshell:bsh to 2.0b6 or later.

## Is CVE-2016-2510 being exploited?

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

## Fix prompt for AI coding agents

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

What it is: CVE-2016-2510 is a high-severity unsafe deserialization vulnerability in Canonical Ubuntu Linux, published on 7 Apr 2016. 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-2510 in the wild and no public exploit code.

Affected packages and fixed versions:
- org.apache-extras.beanshell:bsh (Maven): affected all versions; fixed in 2.0b6
- org.apache-extras.beanshell:bsh (Maven): affected all versions; fixed in 2.0b6

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

## Sources

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

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