CVE-2021-39218 Vulnerability Analysis & Exploit Details

CVE-2021-39218
Vulnerability Scoring

6.3
/10
High Risk

If left unpatched, CVE-2021-39218 could lead to major system disruptions or data loss.

Attack Complexity Details

  • Attack Complexity: High
    Exploits require significant effort and special conditions.
  • Attack Vector: Local
    Vulnerability requires local system access.
  • Privileges Required: Low
    Some privileges are necessary to exploit the vulnerability.
  • Scope: Unchanged
    Exploit remains within the originally vulnerable component.
  • User Interaction: None
    No user interaction is necessary for exploitation.

CVE-2021-39218 Details

Status: Modified

Last updated: 🕕 21 Nov 2024, 06:18 UTC
Originally published on: 🕘 17 Sep 2021, 21:15 UTC

Time between publication and last update: 1160 days

CVSS Release: version 3

CVSS3 Source

security-advisories@github.com

CVSS3 Type

Secondary

CVSS3 Vector

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

CVE-2021-39218 Vulnerability Summary

CVE-2021-39218: Wasmtime is an open source runtime for WebAssembly & WASI. In Wasmtime from version 0.26.0 and before version 0.30.0 is affected by a memory unsoundness vulnerability. There was an invalid free and out-of-bounds read and write bug when running Wasm that uses `externref`s in Wasmtime. To trigger this bug, Wasmtime needs to be running Wasm that uses `externref`s, the host creates non-null `externrefs`, Wasmtime performs a garbage collection (GC), and there has to be a Wasm frame on the stack that is at a GC safepoint where there are no live references at this safepoint, and there is a safepoint with live references earlier in this frame's function. Under this scenario, Wasmtime would incorrectly use the GC stack map for the safepoint from earlier in the function instead of the empty safepoint. This would result in Wasmtime treating arbitrary stack slots as `externref`s that needed to be rooted for GC. At the *next* GC, it would be determined that nothing was referencing these bogus `externref`s (because nothing could ever reference them, because they are not really `externref`s) and then Wasmtime would deallocate them and run `<ExternRef as Drop>::drop` on them. This results in a free of memory that is not necessarily on the heap (and shouldn't be freed at this moment even if it was), as well as potential out-of-bounds reads and writes. Even though support for `externref`s (via the reference types proposal) is enabled by default, unless you are creating non-null `externref`s in your host code or explicitly triggering GCs, you cannot be affected by this bug. We have reason to believe that the effective impact of this bug is relatively small because usage of `externref` is currently quite rare. This bug has been patched and users should upgrade to Wasmtime version 0.30.0. If you cannot upgrade Wasmtime at this time, you can avoid this bug by disabling the reference types proposal by passing `false` to `wasmtime::Config::wasm_reference_types`.

Assessing the Risk of CVE-2021-39218

Access Complexity Graph

The exploitability of CVE-2021-39218 depends on two key factors: attack complexity (the level of effort required to execute an exploit) and privileges required (the access level an attacker needs).

Exploitability Analysis for CVE-2021-39218

This vulnerability, CVE-2021-39218, requires a high level of attack complexity and low privileges, making it difficult but not impossible to exploit. Organizations should ensure robust security configurations to mitigate risks.

Understanding AC and PR

A lower complexity and fewer privilege requirements make exploitation easier. Security teams should evaluate these aspects to determine the urgency of mitigation strategies, such as patch management and access control policies.

Attack Complexity (AC) measures the difficulty in executing an exploit. A high AC means that specific conditions must be met, making an attack more challenging, while a low AC means the vulnerability can be exploited with minimal effort.

Privileges Required (PR) determine the level of system access necessary for an attack. Vulnerabilities requiring no privileges are more accessible to attackers, whereas high privilege requirements limit exploitation to authorized users with elevated access.

CVSS Score Breakdown Chart

Above is the CVSS Sub-score Breakdown for CVE-2021-39218, illustrating how Base, Impact, and Exploitability factors combine to form the overall severity rating. A higher sub-score typically indicates a more severe or easier-to-exploit vulnerability.

CIA Impact Analysis

Below is the Impact Analysis for CVE-2021-39218, showing how Confidentiality, Integrity, and Availability might be affected if the vulnerability is exploited. Higher values usually signal greater potential damage.

  • Confidentiality: None
    CVE-2021-39218 has no significant impact on data confidentiality.
  • Integrity: High
    CVE-2021-39218 could allow unauthorized modifications to data, potentially affecting system reliability and trust.
  • Availability: High
    CVE-2021-39218 can disrupt system operations, potentially causing complete denial of service (DoS).

Exploit Prediction Scoring System (EPSS)

The EPSS score estimates the probability that this vulnerability will be exploited in the near future.

EPSS Score: 0.045% (probability of exploit)

EPSS Percentile: 16.84% (lower percentile = lower relative risk)
This vulnerability is less risky than approximately 83.16% of others.

CVE-2021-39218 References

External References

CWE Common Weakness Enumeration

CWE-787

Vulnerable Configurations

  • cpe:2.3:a:bytecodealliance:wasmtime:0.26.0:*:*:*:*:rust:*:*
    cpe:2.3:a:bytecodealliance:wasmtime:0.26.0:*:*:*:*:rust:*:*
  • cpe:2.3:a:bytecodealliance:wasmtime:0.26.1:*:*:*:*:rust:*:*
    cpe:2.3:a:bytecodealliance:wasmtime:0.26.1:*:*:*:*:rust:*:*
  • cpe:2.3:a:bytecodealliance:wasmtime:0.27.0:*:*:*:*:rust:*:*
    cpe:2.3:a:bytecodealliance:wasmtime:0.27.0:*:*:*:*:rust:*:*
  • cpe:2.3:a:bytecodealliance:wasmtime:0.28.0:*:*:*:*:rust:*:*
    cpe:2.3:a:bytecodealliance:wasmtime:0.28.0:*:*:*:*:rust:*:*
  • cpe:2.3:a:bytecodealliance:wasmtime:0.29.0:*:*:*:*:rust:*:*
    cpe:2.3:a:bytecodealliance:wasmtime:0.29.0:*:*:*:*:rust:*:*
  • cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*
    cpe:2.3:o:fedoraproject:fedora:34:*:*:*:*:*:*:*
  • cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*
    cpe:2.3:o:fedoraproject:fedora:35:*:*:*:*:*:*:*

Protect Your Infrastructure against CVE-2021-39218: Combat Critical CVE Threats

Stay updated with real-time CVE vulnerabilities and take action to secure your systems. Enhance your cybersecurity posture with the latest threat intelligence and mitigation techniques. Develop the skills necessary to defend against CVEs and secure critical infrastructures. Join the top cybersecurity professionals safeguarding today's infrastructures.

Other 5 Recently Published CVEs Vulnerabilities

  • CVE-2025-2129 – A vulnerability was found in Mage AI 0.9.75. It has been classified as problematic. This affects an unknown part. The manipulation leads to insecur...
  • CVE-2025-2127 – A vulnerability was found in JoomlaUX JUX Real Estate 3.4.0 on Joomla. It has been classified as problematic. Affected is an unknown function of th...
  • CVE-2025-2126 – A vulnerability was found in JoomlaUX JUX Real Estate 3.4.0 on Joomla and classified as critical. This issue affects some unknown processing of the...
  • CVE-2025-2125 – A vulnerability has been found in Control iD RH iD 25.2.25.0 and classified as problematic. This vulnerability affects unknown code of the file /v2...
  • CVE-2025-2124 – A vulnerability, which was classified as problematic, was found in Control iD RH iD 25.2.25.0. This affects an unknown part of the file /v2/custome...