Commons BcelApplication · Apache

CVE-2022-42920

CRITICAL · 9.8 CVSS v3.1 Published 2022-11-07
Fix available
A fix is available. Upgrade to 6.6.0 or later.
See remediation →
100/100
Remediation priority · Urgent
Remotely reachable No privileges Zero-click

Official description Straight from the sourceThe vendor's or NVD's own wording, published unedited. Authoritative, but often terse — it says what broke, rarely what to do.

NVD · unedited
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.

Technical summary Written by usOur analysis, written from the advisory, the CVSS vector and the affected-version data. It adds context the advisory leaves out, and never invents facts that are not in the source.

dbcve analysis · high confidence

Apache Commons BCEL contains an out-of-bounds writing vulnerability that allows certain APIs (intended only for modifying specific class characteristics) to produce arbitrary bytecode. Applications passing attacker-controllable data to these BCEL APIs can be exploited to generate malicious bytecode, potentially leading to remote code execution.

MitigationUpdate Apache Commons BCEL to version 6.6.0 or later. Audit code to identify any usage of BCEL APIs that process untrusted input and ensure no attacker-controllable data reaches these vulnerable entry points.

Verify against the referenced sources before acting — the references below are authoritative for this CVE, this summary is not.

Affected products & versions What the vendor confirmedThe version ranges the vendor confirmed as vulnerable. If your version sits inside a range here, treat yourself as exposed until you have upgraded.

NVD · CPE data
Commons BcelApplication
Affected:< 6.6.0
FedoraOperating system
Affected:= 35= 36= 37

CVSS breakdown How the score is builtThe industry scoring standard. It rates how the flaw is reached, what it takes to exploit, and what an attacker gains — the score is derived from those, not the other way round.

From the vector
Attack vector
Network
Complexity
Low
Privileges
None
User interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H

Am I affected? How to checkSteps we derive from the advisory and the affected-version data, so you can decide whether this CVE reaches your setup. They are a guide, not a scan — your own configuration is the authority.

dbcve checks

Work through these to decide whether this CVE applies to you.

  1. Identify Apache Commons BCEL library version
    Locate the BCEL JAR file in your application's classpath or dependencies (commonly named bcel-x.x.jar or commons-bcel-x.x.jar) and check the filename, manifest file inside the JAR, or your dependency management file (Maven pom.xml, Gradle build.gradle) for the version number
    Affected if The installed BCEL version is less than 6.6.0 or the version cannot be determined and BCEL is present in the application
  2. Search for BCEL API usage in source code
    Scan your application source code for imports and usage of org.apache.bcel.* classes, particularly ClassLoader, Utility, Repository, or Constants classes that are used to modify class characteristics or generate bytecode
    Affected if The codebase contains BCEL library imports and uses BCEL APIs to manipulate class bytecode
  3. Trace data flow to BCEL methods
    Review any code paths where external input (HTTP request parameters, user-uploaded files, deserialized data, configuration files, network data) is passed to BCEL API methods such as createClass, defineClass, or Utility methods that modify class attributes
    Affected if Untrusted or attacker-controllable data from external sources reaches BCEL API methods without validation
  4. Check application dependencies for transitive BCEL inclusion
    Examine your application's full dependency tree (mvn dependency:tree or gradle dependencies) to identify if BCEL is included as a transitive dependency, and note which direct dependency pulls it in
    Affected if BCEL is present as a transitive dependency at a version below 6.6.0 regardless of whether it is explicitly declared

Your environment is affected if Apache Commons BCEL version below 6.6.0 is present in the application classpath AND your code passes untrusted external input to BCEL bytecode manipulation APIs.

Generated from the published advisory. Verify against your own configuration.

Check your environment

Paste your version and any relevant configuration and it will be compared against the affected criteria above. Do not include secrets or credentials.

AI-assisted, checked against the advisory. Informational, not a guarantee.

Remediation Closing itWhat it takes to close this. Where a vendor fix exists we point at it; where none exists we say so plainly, and can build one. Effort estimates are scoped from the advisory, not from your codebase.

dbcve · scoped
Upgrade available Upgrade to 6.6.0 or later
Fixed in 6.6.0
Interim mitigation

Update Apache Commons BCEL to version 6.6.0 or later. Audit code to identify any usage of BCEL APIs that process untrusted input and ensure no attacker-controllable data reaches these vulnerable entry points.

Recommended fix High confidence

Apache Commons BCEL 6.6.0

  1. Identify all dependencies that use Apache Commons BCEL in your project
  2. Update the Commons BCEL dependency to version 6.6.0 or later
  3. If using Maven, update the pom.xml dependency: <groupId>org.apache.commons</groupId><artifactId>commons-bcel</artifactId><version>6.6.0</version>
  4. If using Gradle, update build.gradle: implementation 'org.apache.commons:commons-bcel:6.6.0'
  5. Rebuild and test the application to verify the upgrade
  6. Verify no other dependencies require an older version of commons-bcel that would cause conflicts

Generated from the published advisory — verify against the referenced sources before acting.

Fix this in Commons Bcel Scoped from the published advisory
  • Consultation4.0 h
  • Implementation2.0 h
  • Testing8.0 h
  • Review / QA2.0 h
16.0 hours of engineering $2,720
Get the upgrade done

An estimate, not a bill — we confirm scope with you before any work starts. Need it this week? Rush from $4,352.

Scan for this in your stack

Free · runs locally
dbcve dependency scanner

Check whether your project pulls in CVE-2022-42920 — or any other known-vulnerable package — straight from your lock files. Free and open source; it runs locally and uploads nothing.

References Go to the primary sourcePrimary sources — vendor advisories, patches and trackers. Where our summary and a reference disagree, the reference wins.

Primary sources

Practitioner notes

Contributed

Peer-ranked notes from engineers who’ve handled CVE-2022-42920 in production — separate from our analysis above.

No notes yet

Be the first to add a field note for this CVE — a mitigation you’ve verified, a version caveat, or a link to a working fix. Sign in above to contribute.

What this is

A place for practitioners to share what actually worked: a mitigation you’ve tested, a configuration change, a version- or environment-specific caveat, or a link to a verified patch. The most useful notes rise to the top as peers upvote them, so the signal stays high.

What belongs here
  • Verified mitigations, workarounds, and config changes
  • Version or environment caveats, and links to real fixes
  • No weaponised exploit code, or anything meant to cause harm
  • No spam, self-promotion, credentials, or personal data