CVE-2023-38501: Copyparty Cross-Site Scripting Vulnerability

MODERATE
Advisory Identifier: GHSA-f54q-j679-p9hh
CVSS 6.3
CWE-79
Published
Advisory Summary

CVE-2023-38501 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 k304 parameter. Remediation is available by upgrading affected packages to version 1.8.7.

CVE-2023-38501 at a Glance

CVE Identifier CVE-2023-38501
GHSA Identifier GHSA-f54q-j679-p9hh
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 CVE-2023-38501

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.7
pip install copyparty>=1.8.7
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 CVE-2023-38501, 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.7), 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 `?k304=...` and `?setck=...` ### 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 -iE '%0[da]%0[da]%0[da]%0[da]|[?&](hc|pw)=.*[<>]' ``` the above commands also check for attacks against GHSA-cw7j-v52w-fp5r ### PoC `https://localhost:3923/?k304=y%0D%0A%0D%0A%3Cimg+src%3Dcopyparty+onerror%3Dalert(1)%3E`

CVE-2023-38501 Affected Copyparty Versions

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

References

Frequently Asked Questions

What is CVE-2023-38501?
CVE-2023-38501 is a security vulnerability in Copyparty involving copyparty vulnerable to reflected cross-site scripting via k304 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.7 across affected packages: copyparty.
What version fixes CVE-2023-38501?
Upgrading to 1.8.7 (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.7. Upgrade your dependency to 1.8.7 or later.
What is the CVSS score of CVE-2023-38501?
CVE-2023-38501 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 CVE-2023-38501?
CVE-2023-38501 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 CVE-2023-38501?
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-f54q-j679-p9hh",
  "modified" : "2025-09-04T15:32:45Z",
  "published" : "2023-07-25T17:49:21Z",
  "aliases" : [ "CVE-2023-38501" ],
  "summary" : "copyparty vulnerable to reflected cross-site scripting via k304 parameter",
  "details" : "### Summary\nThe application contains a reflected cross-site scripting via URL-parameter `?k304=...` and `?setck=...`\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 -iE '%0[da]%0[da]%0[da]%0[da]|[?&](hc|pw)=.*[<>]'\n  ```\nthe above commands also check for attacks against GHSA-cw7j-v52w-fp5r\n\n### PoC\n`https://localhost:3923/?k304=y%0D%0A%0D%0A%3Cimg+src%3Dcopyparty+onerror%3Dalert(1)%3E`",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "copyparty"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.8.7"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 1.8.6"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/9001/copyparty/security/advisories/GHSA-f54q-j679-p9hh"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-38501"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/9001/copyparty/commit/007d948cb982daa05bc6619cd20ee55b7e834c38"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/9001/copyparty"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/9001/copyparty/releases/tag/v1.8.7"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/copyparty/PYSEC-2023-132.yaml"
  }, {
    "type" : "WEB",
    "url" : "http://packetstormsecurity.com/files/173821/Copyparty-1.8.6-Cross-Site-Scripting.html"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-79" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-07-25T17:49:21Z",
    "nvd_published_at" : "2023-07-25T22:15:10Z"
  }
}