CVE-2022-39242: Pallet ethereum Weight Not Properly Refunded After Vulnerability

MODERATE
Advisory Identifier: GHSA-v57h-6hmh-g2p4
CVSS 5.3
CWE-682
Published
Advisory Summary

CVE-2022-39242 is a MODERATE (CVSS 5.3) weight not properly refunded after vulnerability (CWE-682: Incorrect Calculation) affecting Pallet ethereum libraries in the crates.io ecosystem. The issue involves weight not properly refunded after evm execution. Remediation is available in the latest vendor maintenance releases.

CVE-2022-39242 at a Glance

CVE Identifier CVE-2022-39242
GHSA Identifier GHSA-v57h-6hmh-g2p4
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-682: Incorrect Calculation
Affected Product Pallet ethereum
Package Ecosystem crates.io
Published Date
Last Updated

Security Impact

CVSS: 5.3

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability Low (A:L)

How to Fix CVE-2022-39242

To remediate this vulnerability, upgrade all affected Pallet ethereum dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pallet-ethereum fixed: Latest secure release
Upgrade pallet-ethereum to Latest secure release
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for pallet-ethereum

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-39242, inspect your project dependencies for Pallet ethereum:

inspect dependencies for pallet-ethereum

Analyze the terminal output to locate any version of Pallet ethereum in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than the patched release), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-682: Incorrect Calculation, where the product performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management. In Pallet ethereum, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Previously, the worst case weight was always accounted as the block weight for all cases. In case of large EVM gas refunds, this can lead to block spamming attacks -- the adversary can construct blocks with transactions that have large amount of refunds or unused gases with reverts, and as a result inflate up the chain gas prices. This issue is fixed by properly refund unused weights after each EVM execution. The impact of this issue is limited in that the spamming attack would still be costly for any adversary, and it has no ability to alter any chain state. ### Patches The issue is fixed in https://github.com/paritytech/frontier/pull/851 ### Workarounds None. ### References _Are there any links users can visit to find out more?_ ### For more information If you have any questions or comments about this advisory: * Open an issue in [Frontier repo](https://github.com/paritytech/frontier/issues) * Email [Wei](mailto:wei@that.world)

CVE-2022-39242 Affected Pallet ethereum Versions

1 component(s)
Product / Package Ecosystem Affected Versions Fixed Version
pallet-ethereum
crates.io
≤ 3.0.0

References

Frequently Asked Questions

What is CVE-2022-39242?
CVE-2022-39242 is a security vulnerability in Pallet ethereum involving Weight not properly refunded after EVM execution under CWE-682: Incorrect Calculation.
Which Pallet ethereum versions are affected?
Affected versions include releases prior to current release patches across affected packages: pallet-ethereum.
What version fixes CVE-2022-39242?
Upgrading to current release patches (or the latest patched release for your respective branch) resolves the vulnerability.
Is pallet-ethereum affected?
Yes, pallet-ethereum is affected in releases prior to Latest secure release. Upgrade your dependency to Latest secure release or later.
What is the CVSS score of CVE-2022-39242?
CVE-2022-39242 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L.
What CWE is associated with CVE-2022-39242?
CVE-2022-39242 is classified under CWE-682: Incorrect Calculation (The product performs a calculation that generates incorrect or unintended results that are later used in security-critical decisions or resource management.).
How can I check crates.io dependencies for CVE-2022-39242?
Run the dependency tree command: 'inspect dependencies for pallet-ethereum'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v57h-6hmh-g2p4",
  "modified" : "2024-10-24T21:55:59Z",
  "published" : "2022-09-23T22:07:10Z",
  "aliases" : [ "CVE-2022-39242" ],
  "summary" : "Weight not properly refunded after EVM execution",
  "details" : "### Impact\n\nPreviously, the worst case weight was always accounted as the block weight for all cases. In case of large EVM gas refunds, this can lead to block spamming attacks -- the adversary can construct blocks with transactions that have large amount of refunds or unused gases with reverts, and as a result inflate up the chain gas prices. This issue is fixed by properly refund unused weights after each EVM execution.\n\nThe impact of this issue is limited in that the spamming attack would still be costly for any adversary, and it has no ability to alter any chain state. \n\n### Patches\n\nThe issue is fixed in https://github.com/paritytech/frontier/pull/851\n\n### Workarounds\n\nNone.\n\n### References\n_Are there any links users can visit to find out more?_\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [Frontier repo](https://github.com/paritytech/frontier/issues)\n* Email [Wei](mailto:wei@that.world)\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "crates.io",
      "name" : "pallet-ethereum"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "last_affected" : "3.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/paritytech/frontier/security/advisories/GHSA-v57h-6hmh-g2p4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-39242"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/paritytech/frontier/pull/851"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/paritytech/frontier"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-682" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-09-23T22:07:10Z",
    "nvd_published_at" : "2022-09-24T02:15:00Z"
  }
}