GHSA-cr3w-cw5w-h3fj: @saltcorn/server Remote Code Execution Vulnerability

CRITICAL
CVSS 9.6
CWE-79 CWE-77
Published
Advisory Summary

GHSA-cr3w-cw5w-h3fj is a CRITICAL (CVSS 9.6) remote code execution vulnerability (CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')) affecting @saltcorn/server libraries in the npm ecosystem. The issue involves saltcorn's reflected xss and command injection vulnerabilities can be chained for 1-click-rce. Remediation is available by upgrading affected packages to version 1.5.0-beta.19.

GHSA-cr3w-cw5w-h3fj at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-cr3w-cw5w-h3fj
Severity CRITICAL
CVSS v3.1 Base Score 9.6
CWE Classification CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
Affected Product @saltcorn/server
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.6

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

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix GHSA-cr3w-cw5w-h3fj

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

@saltcorn/server fixed: 1.5.0-beta.19
npm install @saltcorn/server@1.5.0-beta.19
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 @saltcorn/server

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-cr3w-cw5w-h3fj, inspect your project dependencies using npm:

npm ls @saltcorn/server

Analyze the terminal output to locate any version of @saltcorn/server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.0-beta.19), your application is affected.

Note: The npm ls @saltcorn/server 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-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 @saltcorn/server, 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 1. There is a reflected XSS vulnerability in the GET /admin/edit-codepage/:name route through the name parameter. This can be used to hijack the session of an admin if they click a specially crafted link. 2. Additionally, there is a Command Injection vulnerability in GET /admin/backup. The admin can inject a shell command in the backup password which is inserted in the command used to create the backup zip. Both vulnerabilities can be chained to craft a malicious link which will execute an arbitrary shell command on the server if it is clicked by a saltcorn admin with an active session. I believe iframes could also be used to exploit this silently when the admin visits an attacker-controlled web page (though I have not tested that). ### Details 1. The XSS vulnerability is here: https://github.com/saltcorn/saltcorn/blob/020893c0001678fd5ebd2c088ba68b395de1aabc/packages/server/routes/admin.js#L4886-L4887 Specifically, the name parameter is inserted into the pages breadcrumbs without sanitization. 2. The Command Injection happens here: https://github.com/saltcorn/saltcorn/blob/020893c0001678fd5ebd2c088ba68b395de1aabc/packages/saltcorn-admin-models/models/backup.ts#L381-L382 ### PoC 1. A minimal PoC for the XSS can be as simple as: http://localhost:3000/admin/edit-codepage/%3Cimg%20src%3Dx%20onerror%3Dalert%281%29%3E%0A (assuming saltcorn running at localhost:3000 and the user having an active admin session) 2. For the Command Injection, visit the backup section of saltcorn, set an admin password like `";$(whoami);"` (including the quotation marks) and then click "Download a backup" in the "Manual backup" section. This should display an error page saying that /bin/sh could not find the binary named "root" or "saltcorn", depending on the user. An example of an exploit that chains both vulnerabilities and generates the aforementioned malicious link: [exploit.zip](https://github.com/user-attachments/files/24356819/exploit.zip) ### Affected Versions Edit: The following Docker containers from docker hub were tested: 1.4.1, 1.4.0, 1.3.1, 1.3.0, 1.2.0, 1.1.2, 1.1.1, 1.0.0 The Command Injection is applicable to versions >= 1.3.0. The XSS is applicable to versions >= 1.1.1

GHSA-cr3w-cw5w-h3fj Affected @saltcorn/server Versions

1 component(s)
Fixed Versions:
1.5.0-beta.19
Product / Package Ecosystem Affected Versions Fixed Version
@saltcorn/server
npm
≥ 1.1.1
< 1.5.0-beta.19
1.5.0-beta.19

References

Frequently Asked Questions

What is GHSA-cr3w-cw5w-h3fj?
GHSA-cr3w-cw5w-h3fj is a security vulnerability in @saltcorn/server involving Saltcorn's Reflected XSS and Command Injection vulnerabilities can be chained for 1-click-RCE under CWE-79: Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting').
Which @saltcorn/server versions are affected?
Affected versions include releases prior to 1.5.0-beta.19 across affected packages: @saltcorn/server.
What version fixes GHSA-cr3w-cw5w-h3fj?
Upgrading to 1.5.0-beta.19 (or the latest patched release for your respective branch) resolves the vulnerability.
Is @saltcorn/server affected?
Yes, @saltcorn/server is affected in releases prior to 1.5.0-beta.19. Upgrade your dependency to 1.5.0-beta.19 or later.
What is the CVSS score of GHSA-cr3w-cw5w-h3fj?
GHSA-cr3w-cw5w-h3fj has a CVSS v3.1 base score of 9.6 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H.
What CWE is associated with GHSA-cr3w-cw5w-h3fj?
GHSA-cr3w-cw5w-h3fj 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 npm dependencies for GHSA-cr3w-cw5w-h3fj?
Run the dependency tree command: 'npm ls @saltcorn/server'. 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-cr3w-cw5w-h3fj",
  "modified" : "2026-01-26T23:34:49Z",
  "published" : "2026-01-26T23:34:49Z",
  "aliases" : [ ],
  "summary" : "Saltcorn's Reflected XSS and Command Injection vulnerabilities can be chained for 1-click-RCE",
  "details" : "### Summary\n1. There is a reflected XSS vulnerability in the GET /admin/edit-codepage/:name route through the name parameter. This can be used to hijack the session of an admin if they click a specially crafted link.\n2. Additionally, there is a Command Injection vulnerability in GET /admin/backup. The admin can inject a shell command in the backup password which is inserted in the command used to create the backup zip.\n\n\nBoth vulnerabilities can be chained to craft a malicious link which will execute an arbitrary shell command on the server if it is clicked by a saltcorn admin with an active session. I believe iframes could also be used to exploit this silently when the admin visits an attacker-controlled web page (though I have not tested that).\n\n### Details\n1. The XSS vulnerability is here: https://github.com/saltcorn/saltcorn/blob/020893c0001678fd5ebd2c088ba68b395de1aabc/packages/server/routes/admin.js#L4886-L4887 Specifically, the name parameter is inserted into the pages breadcrumbs without sanitization.\n2. The Command Injection happens here: https://github.com/saltcorn/saltcorn/blob/020893c0001678fd5ebd2c088ba68b395de1aabc/packages/saltcorn-admin-models/models/backup.ts#L381-L382\n\n### PoC\n1. A minimal PoC for the XSS can be as simple as: http://localhost:3000/admin/edit-codepage/%3Cimg%20src%3Dx%20onerror%3Dalert%281%29%3E%0A (assuming saltcorn running at localhost:3000 and the user having an active admin session)\n2. For the Command Injection, visit the backup section of saltcorn, set an admin password like `\";$(whoami);\"` (including the quotation marks) and then click \"Download a backup\" in the \"Manual backup\" section. This should display an error page saying that /bin/sh could not find the binary named \"root\" or \"saltcorn\", depending on the user.\n\nAn example of an exploit that chains both vulnerabilities and generates the aforementioned malicious link:\n[exploit.zip](https://github.com/user-attachments/files/24356819/exploit.zip)\n\n### Affected Versions\nEdit: The following Docker containers from docker hub were tested: 1.4.1, 1.4.0, 1.3.1, 1.3.0, 1.2.0, 1.1.2, 1.1.1, 1.0.0\nThe Command Injection is applicable to versions >= 1.3.0.\nThe XSS is applicable to versions >= 1.1.1",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "@saltcorn/server"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "1.1.1"
      }, {
        "fixed" : "1.5.0-beta.19"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/saltcorn/saltcorn/security/advisories/GHSA-cr3w-cw5w-h3fj"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/saltcorn/saltcorn/commit/1bf681e08c45719a52afcf3506fb5ec59f4974d5"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/saltcorn/saltcorn"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/saltcorn/saltcorn/blob/020893c0001678fd5ebd2c088ba68b395de1aabc/packages/saltcorn-admin-models/models/backup.ts#L381-L382"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/saltcorn/saltcorn/blob/020893c0001678fd5ebd2c088ba68b395de1aabc/packages/server/routes/admin.js#L4886-L4887"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-77", "CWE-79" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-01-26T23:34:49Z",
    "nvd_published_at" : null
  }
}