Vulnerabilities in pkg:pypi/mofh

PACKAGE
Advisory Summary

GHSA-7r9x-qrpr-3cxw is a MODERATE mofh vulnerable to improper restriction vulnerability (CWE-611: Improper Restriction of XML External Entity Reference) affecting Mofh libraries in the PyPI ecosystem. The issue involves mofh vulnerable to improper restriction of xml external entity reference. Remediation is available by upgrading affected packages to version 1.0.1.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:pypi/mofh

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:pypi/mofh. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-7r9x-qrpr-3cxw - MODERATE mofh Vulnerable to Improper Restriction of XML External Entity Reference

GHSA-7r9x-qrpr-3cxw at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-7r9x-qrpr-3cxw
Severity MODERATE
CVSS v3.1 Base Score N/A
CWE Classification CWE-611: Improper Restriction of XML External Entity Reference
Affected Product Mofh
Package Ecosystem PyPI
Published Date
Last Updated

How to Fix GHSA-7r9x-qrpr-3cxw

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

mofh fixed: 1.0.1
pip install mofh>=1.0.1
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 mofh

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-7r9x-qrpr-3cxw, inspect your installed packages using pip:

pip show mofh

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

Note: The pip show mofh 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 Mofh, 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

The `xml.etree.ElementTree` module that mofh used up until version `1.0.1` implements a simple and efficient API for parsing and creating XML data. But it makes the application vulnerable to: - [Billion Laughs attack](https://en.wikipedia.org/wiki/Billion_laughs_attack): It is a type of denial-of-service attack aimed at XML parsers. It uses multiple levels of nested entities. If one large entity is repeated with a couple of thousand chars repeatedly, the parser gets overwhelmed. - [Quadratic blowup attack](https://www.acunetix.com/vulnerabilities/web/xml-quadratic-blowup-denial-of-service-attack/): It is similar to a Billion Laughs attack. It abuses entity expansion, too. Instead of nested entities, it repeats one large entity with a couple of thousand chars repeatedly. The Problem has been patched starting from version `1.0.1` by utilising the `defusedxml` package instead of `xml.etree.ElementTree`. ### Workarounds For this vulnerability to be exploited the user must be using a custom API URL, which has to be manually given using the `api_url` argument, or MyOwnFreeHost's API must be hacked. So, if the user did not use a custom API URL they _should_ be fine, however, upgrading is still advised. Another workaround could be to call `defusedxml.defuse_stdlib()` before making any requests using the client.

GHSA-7r9x-qrpr-3cxw Affected Mofh Versions

1 component(s)
Fixed Versions:
1.0.1
Product / Package Ecosystem Affected Versions Fixed Version
mofh
PyPI
< 1.0.1
1.0.1

References

Frequently Asked Questions

What is GHSA-7r9x-qrpr-3cxw?
GHSA-7r9x-qrpr-3cxw is a security vulnerability in Mofh involving mofh Vulnerable to Improper Restriction of XML External Entity Reference under CWE-611: Improper Restriction of XML External Entity Reference.
Which Mofh versions are affected?
Affected versions include releases prior to 1.0.1 across affected packages: mofh.
What version fixes GHSA-7r9x-qrpr-3cxw?
Upgrading to 1.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is mofh affected?
Yes, mofh is affected in releases prior to 1.0.1. Upgrade your dependency to 1.0.1 or later.
What CWE is associated with GHSA-7r9x-qrpr-3cxw?
GHSA-7r9x-qrpr-3cxw 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 GHSA-7r9x-qrpr-3cxw?
Run the dependency tree command: 'pip show mofh'. 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-7r9x-qrpr-3cxw",
  "modified" : "2022-08-11T18:06:05Z",
  "published" : "2022-08-11T18:06:05Z",
  "aliases" : [ ],
  "summary" : "mofh Vulnerable to Improper Restriction of XML External Entity Reference",
  "details" : "The `xml.etree.ElementTree` module that mofh used up until version `1.0.1` implements a simple and efficient API for parsing and creating XML data. But it makes the application vulnerable to:\n\n- [Billion Laughs attack](https://en.wikipedia.org/wiki/Billion_laughs_attack): It is a type of denial-of-service attack aimed at XML parsers. It uses multiple levels of nested entities. If one large entity is repeated with a couple of thousand chars repeatedly, the parser gets overwhelmed.  \n- [Quadratic blowup attack](https://www.acunetix.com/vulnerabilities/web/xml-quadratic-blowup-denial-of-service-attack/): It is similar to a Billion Laughs attack. It abuses entity expansion, too. Instead of nested entities, it repeats one large entity with a couple of thousand chars repeatedly.\n\nThe Problem has been patched starting from version `1.0.1` by utilising the `defusedxml` package instead of `xml.etree.ElementTree`.\n\n### Workarounds\nFor this vulnerability to be exploited the user must be using a custom API URL, which has to be manually given using the `api_url` argument, or MyOwnFreeHost's API must be hacked. So, if the user did not use a custom API URL they _should_ be fine, however, upgrading is still advised.\n\nAnother workaround could be to call `defusedxml.defuse_stdlib()` before making any requests using the client.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "mofh"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/Wallvon/mofh/security/advisories/GHSA-7r9x-qrpr-3cxw"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/Wallvon/mofh/commit/da0d33cfd368e2f237ab28bf7a7f00e3d281005a"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/Wallvon/mofh"
  }, {
    "type" : "WEB",
    "url" : "https://www.acunetix.com/vulnerabilities/web/xml-quadratic-blowup-denial-of-service-attack"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-611" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-08-11T18:06:05Z",
    "nvd_published_at" : null
  }
}