GHSA-cw7j-v52w-fp5r: Copyparty Cross-Site Scripting Vulnerability

MODERATE
CVSS 6.3
CWE-79
Published
Advisory Summary

GHSA-cw7j-v52w-fp5r is a MODERATE (CVSS 6.3) cross-site scripting vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting Copyparty libraries in the PyPI ecosystem. The issue involves copyparty vulnerable to reflected cross-site scripting via hc parameter. Remediation is available by upgrading affected packages to version 1.8.6.

GHSA-cw7j-v52w-fp5r at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-cw7j-v52w-fp5r
Severity MODERATE
CVSS v3.1 Base Score 6.3
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product Copyparty
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 6.3

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:R/S:U/C:L/I:L/A:L).

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

How to Fix GHSA-cw7j-v52w-fp5r

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

copyparty fixed: 1.8.6
pip install copyparty>=1.8.6
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 copyparty

How to Check if You Are Affected

To determine whether your Python environment is affected by GHSA-cw7j-v52w-fp5r, inspect your installed packages using pip:

pip show copyparty

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

Note: The pip show copyparty 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 Copyparty, 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

### Summary The application contains a reflected cross-site scripting via URL-parameter `?hc=...` ### Details A reflected cross-site scripting (XSS) vulnerability exists in the web interface of the application that could allow an attacker to execute malicious javascript code by tricking users into accessing a malicious link. The worst-case outcome of this is being able to move or delete existing files on the server, or upload new files, using the account of the person who clicks the malicious link. It is recommended to change the passwords of your copyparty accounts, unless you have inspected your logs and found no trace of attacks. ### Checking for exposure if copyparty is running behind a reverse proxy, you can check the access-logs for traces of attacks, by grepping for URLs containing `?hc=` with `<` somewhere in its value, for example using the following command: * nginx: ```bash (gzip -dc access.log*.gz; cat access.log) | sed -r 's/" [0-9]+ .*//' | grep -E '[?&](hc|pw)=.*[<>]' ``` ### PoC * `http://127.0.0.1:3923/?hc="><script>alert(1);</script>` * `http://127.0.0.1:3923/?pw=<script>alert(1);</script>`

GHSA-cw7j-v52w-fp5r Affected Copyparty Versions

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

References

Frequently Asked Questions

What is GHSA-cw7j-v52w-fp5r?
GHSA-cw7j-v52w-fp5r is a security vulnerability in Copyparty involving copyparty vulnerable to reflected cross-site scripting via hc parameter under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which Copyparty versions are affected?
Affected versions include releases prior to 1.8.6 across affected packages: copyparty.
What version fixes GHSA-cw7j-v52w-fp5r?
Upgrading to 1.8.6 (or the latest patched release for your respective branch) resolves the vulnerability.
Is copyparty affected?
Yes, copyparty is affected in releases prior to 1.8.6. Upgrade your dependency to 1.8.6 or later.
What is the CVSS score of GHSA-cw7j-v52w-fp5r?
GHSA-cw7j-v52w-fp5r has a CVSS v3.1 base score of 6.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L.
What CWE is associated with GHSA-cw7j-v52w-fp5r?
GHSA-cw7j-v52w-fp5r 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-cw7j-v52w-fp5r?
Run the dependency tree command: 'pip show copyparty'. 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-cw7j-v52w-fp5r",
  "modified" : "2023-07-24T16:55:19Z",
  "published" : "2023-07-21T20:20:56Z",
  "aliases" : [ ],
  "summary" : "copyparty vulnerable to reflected cross-site scripting via hc parameter",
  "details" : "### Summary\nThe application contains a reflected cross-site scripting via URL-parameter `?hc=...`\n\n### Details\nA reflected cross-site scripting (XSS) vulnerability exists in the web interface of the application that could allow an attacker to execute malicious javascript code by tricking users into accessing a malicious link.\n\nThe worst-case outcome of this is being able to move or delete existing files on the server, or upload new files, using the account of the person who clicks the malicious link.\n\nIt is recommended to change the passwords of  your copyparty accounts, unless you have inspected your logs and found no trace of attacks.\n\n### Checking for exposure\nif copyparty is running behind a reverse proxy, you can check the access-logs for traces of attacks, by grepping for URLs containing `?hc=` with `<` somewhere in its value, for example using the following command:\n* nginx:\n  ```bash\n  (gzip -dc access.log*.gz; cat access.log) | sed -r 's/\" [0-9]+ .*//' | grep -E '[?&](hc|pw)=.*[<>]'\n  ```\n\n\n### PoC\n* `http://127.0.0.1:3923/?hc=\"><script>alert(1);</script>`\n* `http://127.0.0.1:3923/?pw=<script>alert(1);</script>`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "copyparty"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.6"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/9001/copyparty/security/advisories/GHSA-cw7j-v52w-fp5r"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/9001/copyparty/commit/0778da6c4d04de870c61f970763a7b619094093c"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/9001/copyparty"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/9001/copyparty/releases/tag/v1.8.6"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-21T20:20:56Z",
    "nvd_published_at" : null
  }
}