Arbitrary Code Execution Vulnerability in Jython: CVE-2016-4000

jython Updated 02 Oct 2025

Summary

06/07/2017
N/A
Yes i
Critical
9.8

CVE-2016-4000: Jython before 2.7.1rc1 allows attackers to execute arbitrary code via a crafted serialized PyFunction object. Affects jython versions < 2.5.3-17. Fixed in 2.5.3-17. How to fix ↓

Free scan

Check if this vulnerability affects your application

Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Jython is an implementation of the Python programming language designed to run on the Java platform. It allows seamless integration of Java and Python, enabling developers to use Java libraries in Python code. Jython is widely used in various applications for scripting and automation. However, prior to version 2.7.1rc1, Jython was vulnerable to a critical security flaw that could allow attackers to execute arbitrary code through a specially crafted serialized PyFunction object.

Vulnerability Detail

CVE-2016-4000 is a vulnerability in Jython that allows attackers to execute arbitrary code by exploiting a crafted serialized PyFunction object. This vulnerability arises from improper handling of serialized objects, which can lead to remote code execution. Attackers can leverage this flaw to gain unauthorized access to the system, potentially leading to data breaches, system compromise, and further exploitation of the affected environment. The CVSS score for this vulnerability is 9.8, indicating a critical severity level.

How To Fix

Minimum fixed version

2.5.3-17

This is the first release that contains the fix.

sudo apt-get install --only-upgrade jython

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading is not immediately possible, consider implementing strict input validation and sanitization for any serialized PyFunction objects. Additionally, avoid deserializing untrusted data and limit the use of Jython in environments where security is a critical concern.

Conclusion

CVE-2016-4000 is a critical vulnerability in Jython that allows for arbitrary code execution through crafted serialized objects. Users are strongly advised to upgrade to the latest version to mitigate risks. For those unable to upgrade immediately, implementing workarounds can provide temporary protection.

See every vulnerability recorded for jython →

Share this vulnerability

FAQ

CVE-2016-4000 is a vulnerability in Jython that allows arbitrary code execution through crafted serialized PyFunction objects.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.

The vulnerability can lead to unauthorized access, data breaches, and system compromise, allowing attackers to execute arbitrary code on the affected system.

The recommended action is to upgrade Jython to version 2.5.3-17 or later to eliminate the vulnerability.

Yes, implementing strict input validation and avoiding deserialization of untrusted data can provide temporary protection until an upgrade is performed.

Related vulnerabilities

Recent vulnerabilities recorded for jython.

How To Fix

Minimum fixed version

2.5.3-17

This is the first release that contains the fix.

sudo apt-get install --only-upgrade jython

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback