GHSA-c58j-88f5-h53f: Pycares Cross-Site Scripting Vulnerability

MODERATE
CVSS 5.6
CWE-79
Published
Advisory Summary

GHSA-c58j-88f5-h53f is a MODERATE (CVSS 5.6) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Pycares libraries in the PyPI ecosystem. The issue involves improper neutralization of input during web page generation ('cross-site scripting') in pycares. Remediation is available by upgrading affected packages to version 4.2.0.

GHSA-c58j-88f5-h53f at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-c58j-88f5-h53f
Severity MODERATE
CVSS v3.1 Base Score 5.6
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Pycares
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 5.6

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

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

How to Fix GHSA-c58j-88f5-h53f

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

pycares fixed: 4.2.0
pip install pycares>=4.2.0
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 pycares

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-c58j-88f5-h53f, inspect your installed packages using pip:

pip show pycares

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

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

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting'), where the product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. In Pycares, 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 pycares versions < 4.2.0 are affected by [CVE-2021-3672](https://nvd.nist.gov/vuln/detail/CVE-2021-3672). ### Patches Update to version 4.2.0.

GHSA-c58j-88f5-h53f Affected Pycares Versions

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

References

Frequently Asked Questions

What is GHSA-c58j-88f5-h53f?
GHSA-c58j-88f5-h53f is a security vulnerability in Pycares involving Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in pycares under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Pycares versions are affected?
Affected versions include releases prior to 4.2.0 across affected packages: pycares.
What version fixes GHSA-c58j-88f5-h53f?
Upgrading to 4.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pycares affected?
Yes, pycares is affected in releases prior to 4.2.0. Upgrade your dependency to 4.2.0 or later.
What is the CVSS score of GHSA-c58j-88f5-h53f?
GHSA-c58j-88f5-h53f has a CVSS v3.1 base score of 5.6 (MODERATE) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L.
What CWE is associated with GHSA-c58j-88f5-h53f?
GHSA-c58j-88f5-h53f is classified under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') (The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users.).
How can I check PyPI dependencies for GHSA-c58j-88f5-h53f?
Run the dependency tree command: 'pip show pycares'. 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-c58j-88f5-h53f",
  "modified" : "2022-07-05T22:08:20Z",
  "published" : "2022-07-05T22:08:20Z",
  "aliases" : [ ],
  "summary" : "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting') in pycares",
  "details" : "### Impact\n\npycares versions < 4.2.0 are affected by [CVE-2021-3672](https://nvd.nist.gov/vuln/detail/CVE-2021-3672).\n\n### Patches\n\nUpdate to version 4.2.0.\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "pycares"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/saghul/pycares/security/advisories/GHSA-c58j-88f5-h53f"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/saghul/pycares"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-07-05T22:08:20Z",
    "nvd_published_at" : null
  }
}