CVE-2017-6952: Capstone Capstone Integer Overflow Vulnerability

HIGH
Advisory Identifier: GHSA-3v99-hpv7-9hh9
CVSS 8.8
CWE-190
Published
Advisory Summary

CVE-2017-6952 is a HIGH (CVSS 8.8) capstone integer overflow vulnerability (CWE-190: Integer Overflow or Wraparound) affecting Capstone libraries in the PyPI ecosystem. The issue involves capstone integer overflow. Remediation is available by upgrading affected packages to version 3.0.5rc2.

CVE-2017-6952 at a Glance

CVE Identifier CVE-2017-6952
GHSA Identifier GHSA-3v99-hpv7-9hh9
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-190: Integer Overflow or Wraparound
Affected Product Capstone
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.8

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

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

How to Fix CVE-2017-6952

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

capstone fixed: 3.0.5rc2
pip install capstone>=3.0.5rc2
Verify Direct and Transitive Dependencies

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

pip show capstone

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2017-6952, inspect your installed packages using pip:

pip show capstone

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

Note: The pip show capstone command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-190: Integer Overflow or Wraparound, where the product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. this occurs when an integer value is incremented to a value that is too large to store in the associated representation. when this occurs, the value may become a very small or negative number. In Capstone, 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

Integer overflow in the cs_winkernel_malloc function in winkernel_mm.c in Capstone 3.0.4 and earlier allows attackers to cause a denial of service (heap-based buffer overflow in a kernel driver) or possibly have unspecified other impact via a large value.

CVE-2017-6952 Affected Capstone Versions

1 component(s)
Fixed Versions:
3.0.5rc2
Product / Package Ecosystem Affected Versions Fixed Version
capstone
PyPI
< 3.0.5rc2
3.0.5rc2

References

Frequently Asked Questions

What is CVE-2017-6952?
CVE-2017-6952 is a security vulnerability in Capstone involving Capstone Integer overflow under CWE-190: Integer Overflow or Wraparound.
Which Capstone versions are affected?
Affected versions include releases prior to 3.0.5rc2 across affected packages: capstone.
What version fixes CVE-2017-6952?
Upgrading to 3.0.5rc2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is capstone affected?
Yes, capstone is affected in releases prior to 3.0.5rc2. Upgrade your dependency to 3.0.5rc2 or later.
What is the CVSS score of CVE-2017-6952?
CVE-2017-6952 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2017-6952?
CVE-2017-6952 is classified under CWE-190: Integer Overflow or Wraparound (The product performs a calculation that can produce an integer overflow or wraparound when the logic assumes that the resulting value will always be larger than the original value. This occurs when an integer value is incremented to a value that is too large to store in the associated representation. When this occurs, the value may become a very small or negative number.).
How can I check PyPI dependencies for CVE-2017-6952?
Run the dependency tree command: 'pip show capstone'. 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-3v99-hpv7-9hh9",
  "modified" : "2024-11-21T22:17:39Z",
  "published" : "2022-05-17T02:51:51Z",
  "aliases" : [ "CVE-2017-6952" ],
  "summary" : "Capstone Integer overflow",
  "details" : "Integer overflow in the cs_winkernel_malloc function in winkernel_mm.c in Capstone 3.0.4 and earlier allows attackers to cause a denial of service (heap-based buffer overflow in a kernel driver) or possibly have unspecified other impact via a large value.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "capstone"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.0.5rc2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2017-6952"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/aquynh/capstone/commit/6fe86eef621b9849f51a5e1e5d73258a93440403"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/capstone-engine/capstone"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/capstone/PYSEC-2017-113.yaml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-190" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-11-21T22:17:39Z",
    "nvd_published_at" : "2017-03-16T21:59:00Z"
  }
}