CVE-2024-31454: PsiTransfer File Integrity Violation Vulnerability

MODERATE
Advisory Identifier: GHSA-2p2x-p7wj-j5h2
CVSS 6.5
CWE-434
Published
Advisory Summary

CVE-2024-31454 is a MODERATE (CVSS 6.5) file integrity violation vulnerability (CWE-434: Unrestricted Upload of File with Dangerous Type) affecting PsiTransfer libraries in the npm ecosystem. The issue involves file integrity violation. Remediation is available by upgrading affected packages to version 2.2.0.

CVE-2024-31454 at a Glance

CVE Identifier CVE-2024-31454
GHSA Identifier GHSA-2p2x-p7wj-j5h2
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-434: Unrestricted Upload of File with Dangerous Type
Affected Product PsiTransfer
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

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

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

How to Fix CVE-2024-31454

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

psitransfer fixed: 2.2.0
npm install psitransfer@2.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:

npm ls psitransfer

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2024-31454, inspect your project dependencies using npm:

npm ls psitransfer

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

Note: The npm ls psitransfer command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-434: Unrestricted Upload of File with Dangerous Type, where the product allows the upload or transfer of dangerous file types that are automatically processed within its environment. In PsiTransfer, 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 absence of restrictions on the endpoint, which is designed for uploading files, allows an attacker who received the id of a file distribution to change the files that are in this distribution. ### Details Vulnerable endpoint: PATCH /files/{{id}} ### PoC 1. Create a file distribution. 2. Go to the link address for downloading files and download the file (in this case, the attacker receives the file id from the download request). 3. Send a PATCH /files/{{id}} request with arbitrary content in the request body. Thus, the file with the specified id will be changed. What the attacker specifies in the body of the request will be added to the end of the original content. In the future, users will download the modified file. ### Impact The vulnerability allows an attacker to influence those users who come to the file distribution after him and slip the victim files with a malicious or phishing signature.

CVE-2024-31454 Affected PsiTransfer Versions

1 component(s)
Fixed Versions:
2.2.0
Product / Package Ecosystem Affected Versions Fixed Version
psitransfer
npm
< 2.2.0
2.2.0

References

Frequently Asked Questions

What is CVE-2024-31454?
CVE-2024-31454 is a security vulnerability in PsiTransfer involving File integrity violation under CWE-434: Unrestricted Upload of File with Dangerous Type.
Which PsiTransfer versions are affected?
Affected versions include releases prior to 2.2.0 across affected packages: psitransfer.
What version fixes CVE-2024-31454?
Upgrading to 2.2.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is psitransfer affected?
Yes, psitransfer is affected in releases prior to 2.2.0. Upgrade your dependency to 2.2.0 or later.
What is the CVSS score of CVE-2024-31454?
CVE-2024-31454 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N.
What CWE is associated with CVE-2024-31454?
CVE-2024-31454 is classified under CWE-434: Unrestricted Upload of File with Dangerous Type (The product allows the upload or transfer of dangerous file types that are automatically processed within its environment.).
How can I check npm dependencies for CVE-2024-31454?
Run the dependency tree command: 'npm ls psitransfer'. 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-2p2x-p7wj-j5h2",
  "modified" : "2024-04-09T18:47:05Z",
  "published" : "2024-04-05T17:15:27Z",
  "aliases" : [ "CVE-2024-31454" ],
  "summary" : "PsiTransfer: File integrity violation",
  "details" : "### Summary\nThe absence of restrictions on the endpoint, which is designed for uploading files, allows an attacker who received the id of a file distribution to change the files that are in this distribution.\n\n### Details\nVulnerable endpoint: PATCH /files/{{id}}\n\n### PoC\n1. Create a file distribution.\n\n2. Go to the link address for downloading files and download the file (in this case, the attacker receives the file id from the download request).\n\n3. Send a PATCH /files/{{id}} request with arbitrary content in the request body.\n\nThus, the file with the specified id will be changed. What the attacker specifies in the body of the request will be added to the end of the original content. In the future, users will download the modified file.\n\n### Impact\nThe vulnerability allows an attacker to influence those users who come to the file distribution after him and slip the victim files with a malicious or phishing signature.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:H/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "psitransfer"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "2.2.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/psi-4ward/psitransfer/security/advisories/GHSA-2p2x-p7wj-j5h2"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-31454"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/psi-4ward/psitransfer/commit/0014d81141e0f1664ccb6841970ef1ea0237cca3"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/psi-4ward/psitransfer"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-434" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-04-05T17:15:27Z",
    "nvd_published_at" : "2024-04-09T18:15:10Z"
  }
}