Out-of-Bounds Write Vulnerability in Apache Commons BCEL Package

bcel Updated 02 Oct 2025

Summary

07/11/2022
N/A
Yes i
Unrated
Not published

DEBIAN-CVE-2022-42920: Apache Commons BCEL has a number of APIs that would normally only allow changing specific class characteristics. Affects bcel versions < 6.5.0-1+deb11u1. Fixed in 6.5.0-1+deb11u1. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

Apache Commons BCEL (Byte Code Engineering Library) is a Java library that provides APIs for analyzing, creating, and manipulating Java bytecode. It allows developers to dynamically generate and modify Java classes at runtime. The library is widely used in various applications that require bytecode manipulation. However, it has been found to have a vulnerability that can lead to arbitrary bytecode generation, posing a significant security risk.

Vulnerability Detail

The vulnerability arises from an out-of-bounds writing issue in several APIs of the Apache Commons BCEL. These APIs, which are intended to modify specific class characteristics, can be exploited to produce arbitrary bytecode when attacker-controllable data is passed to them. This could allow an attacker to gain more control over the resulting bytecode than intended, potentially leading to malicious code execution within applications that utilize BCEL.

How To Fix

Minimum fixed version

6.5.0-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade bcel

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

Workaround

As a temporary workaround, it is advisable to validate and sanitize any input data that is passed to the BCEL APIs to prevent the exploitation of this vulnerability. This can help mitigate the risk until the package is updated.

Conclusion

The Apache Commons BCEL package has a critical vulnerability that can lead to arbitrary bytecode generation due to an out-of-bounds write issue. It is crucial for users to update to the patched versions of the package to mitigate the risk of exploitation. Regular monitoring and updating of dependencies are essential for maintaining application security.

See every vulnerability recorded for bcel →

Share this vulnerability

FAQ

Apache Commons BCEL is a Java library that provides tools for analyzing and manipulating Java bytecode, enabling dynamic generation and modification of Java classes.

The out-of-bounds write vulnerability allows attackers to exploit certain APIs in BCEL to generate arbitrary bytecode, potentially leading to malicious code execution.

You can use Vulert, which monitors open-source vulnerabilities in your software using a manifest file like package-lock.json. Visit Vulert Scanner to check your application without requiring signup.

Failing to address this vulnerability could lead to unauthorized code execution, data breaches, and compromise of the affected applications.

It is recommended to regularly check for updates and security patches for all dependencies, ideally on a monthly basis or as soon as vulnerabilities are disclosed.

Related vulnerabilities

Recent vulnerabilities recorded for bcel.

How To Fix

Minimum fixed version

6.5.0-1+deb11u1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade bcel

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