CVE-2018-25082: Weixin python Weixin-python XML External Entity Vulnerability Vulnerability

CRITICAL
Advisory Identifier: GHSA-h384-ph77-3699
CVSS 9.8
CWE-611
Published
Advisory Summary

CVE-2018-25082 is a CRITICAL (CVSS 9.8) weixin-python xml external entity vulnerability vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Weixin python libraries in the PyPI ecosystem. The issue involves weixin-python xml external entity vulnerability. Remediation is available by upgrading affected packages to version 0.5.5.

CVE-2018-25082 at a Glance

CVE Identifier CVE-2018-25082
GHSA Identifier GHSA-h384-ph77-3699
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Weixin python
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 9.8

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:H/I:H/A:H).

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 High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2018-25082

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

weixin-python fixed: 0.5.5
pip install weixin-python>=0.5.5
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 weixin-python

How to Check if You Are Affected

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

pip show weixin-python

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-611: Improper Restriction of XML External Entity Reference, where the product processes an xml document that can contain xml entities with uris that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output. In Weixin python, 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

A vulnerability was found in zwczou WeChat SDK Python 0.3.0 and classified as critical. This issue affects the function validate/to_xml. The manipulation leads to xml external entity reference. The attack may be initiated remotely. Upgrading to version 0.5.5 is able to address this issue. The name of the patch is e54abadc777715b6dcb545c13214d1dea63df6c9. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-223403.

CVE-2018-25082 Affected Weixin python Versions

1 component(s)
Fixed Versions:
0.5.5
Product / Package Ecosystem Affected Versions Fixed Version
weixin-python
PyPI
< 0.5.5
0.5.5

References

Frequently Asked Questions

What is CVE-2018-25082?
CVE-2018-25082 is a security vulnerability in Weixin python involving weixin-python XML External Entity vulnerability under CWE-611: Improper Restriction of XML External Entity Reference.
Which Weixin python versions are affected?
Affected versions include releases prior to 0.5.5 across affected packages: weixin-python.
What version fixes CVE-2018-25082?
Upgrading to 0.5.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is weixin-python affected?
Yes, weixin-python is affected in releases prior to 0.5.5. Upgrade your dependency to 0.5.5 or later.
What is the CVSS score of CVE-2018-25082?
CVE-2018-25082 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2018-25082?
CVE-2018-25082 is classified under CWE-611: Improper Restriction of XML External Entity Reference (The product processes an XML document that can contain XML entities with URIs that resolve to documents outside of the intended sphere of control, causing the product to embed incorrect documents into its output.).
How can I check PyPI dependencies for CVE-2018-25082?
Run the dependency tree command: 'pip show weixin-python'. 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-h384-ph77-3699",
  "modified" : "2023-03-24T22:19:53Z",
  "published" : "2023-03-21T18:30:19Z",
  "aliases" : [ "CVE-2018-25082" ],
  "summary" : "weixin-python XML External Entity vulnerability",
  "details" : "A vulnerability was found in zwczou WeChat SDK Python 0.3.0 and classified as critical. This issue affects the function validate/to_xml. The manipulation leads to xml external entity reference. The attack may be initiated remotely. Upgrading to version 0.5.5 is able to address this issue. The name of the patch is e54abadc777715b6dcb545c13214d1dea63df6c9. It is recommended to upgrade the affected component. The associated identifier of this vulnerability is VDB-223403.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "weixin-python"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.5.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2018-25082"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zwczou/weixin-python/pull/30"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zwczou/weixin-python/commit/e54abadc777715b6dcb545c13214d1dea63df6c9"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/zwczou/weixin-python"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/zwczou/weixin-python/releases/tag/v0.5.5"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?ctiid.223403"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.223403"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-03-21T22:41:46Z",
    "nvd_published_at" : "2023-03-21T18:15:00Z"
  }
}