Cloudanix VulnDB

CVE-2016-2510

High · 8.1

CVSS

8.1

EPSS

70.4%

Published

Apr 7, 2016

CISA due date

—

Cloudanix analysis

Schedule a fix SSVC: Attend

A widely used scripting library can let attackers take over a server by sending specially crafted data that the application tries to read.

Exploit Available Chainable
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
High
Impact
Remote Code Execution
Component
Library
Class
Deserialization
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

BeanShell on the classpath enables remote code execution when an application deserializes attacker-controlled Java objects or XStream data, because the library's XThis.Handler handler can be abused to invoke arbitrary methods during deserialization.

Why it matters to the business

Unpatched applications that bundle vulnerable BeanShell versions remain exposed to full remote compromise; organizations still shipping the affected packages must treat the flaw as an immediate upgrade priority despite its age.

How an attack unfolds

An attacker crafts a malicious serialized Java object (or XStream XML) that references BeanShell's XThis.Handler; when the target application deserializes the payload, the handler is invoked and attacker-supplied code executes with the privileges of the deserializing process.

How to fix it

Upgrade litestream to 0.3.13-r2 (Chainguard or Wolfi) and beanshell/beanshell to commit 1ccc66bb693d4e46a34a904db8eeff07808d2ced; remove BeanShell from the classpath if it is not required.

How to confirm the fix worked

Confirm the exact package version installed matches a fixed release, then run a deserialization test harness that exercises the previously vulnerable XThis.Handler path to verify it no longer executes attacker code.

Typical attack path

  1. Identify an application endpoint that accepts or processes Java-serialized data or XStream input
  2. Craft a serialized object that triggers BeanShell's XThis.Handler during deserialization
  3. Deliver the payload over the network or via a file upload
  4. Obtain arbitrary code execution on the server

How to detect it

Search application and web-server logs for unexpected deserialization exceptions or BeanShell class loading immediately before process creation events; review historic network captures for large serialized blobs or XStream payloads sent to affected endpoints.

What your security team should do

  • Immediately inventory all builds that include BeanShell and schedule upgrades to the listed fixed versions
  • Add dependency scanning rules that block any BeanShell release before 2.0b6
  • Review application code for direct or transitive use of Java serialization or XStream and apply safe deserialization patterns

The record

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.

Affected packages

Ecosystem Package Introduced Fixed
Maven org.apache-extras.beanshell:bsh 0 2.0b6
Debian:11 bsh 0 2.0b4-16
Debian:12 bsh 0 2.0b4-16
Debian:13 bsh 0 2.0b4-16
Debian:6.0 bsh 0 2.0b4-12+deb6u1
Debian:7 bsh 0 2.0b4-12+deb7u1
Debian:8 bsh 0 2.0b4-15+deb8u1
SUSE:Linux Enterprise Software Development Kit 11 SP4 bsh2 0 2.0-318.1
SUSE:Linux Enterprise Software Development Kit 12 bsh2 0 2.0.0.b5-3.2
SUSE:Linux Enterprise Software Development Kit 12 SP1 bsh2 0 2.0.0.b5-3.2
Ubuntu:14.04:LTS bsh 0 2.0b4-15ubuntu0.14.04.1
maven org.apache-extras.beanshell/bsh 2.0b5 2.0b6
openSUSE:Tumbleweed bsh2 0 2.0.0.b6-2.7

Related vulnerabilities