@saltcorn/server
Affected
- introduced
1.1.1, fixed1.5.0-beta.19(semver)
Fixed versions
1.5.0-beta.19
Fix
- Fixed version
1.5.0-beta.19npm install @saltcorn/[email protected]
Advisory
Also known as: None
Saltcorn's Reflected XSS and Command Injection vulnerabilities can be chained for 1-click-RCE
Summary
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
PoC
";$(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
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
Critical Basis: The source's own band: CRITICAL
1.1.1, fixed 1.5.0-beta.19 (semver)1.5.0-beta.19
1.5.0-beta.19npm install @saltcorn/[email protected]Fix commands are the export's own generic commands. Ojuju never runs them. Check them against your setup first.
Check your own computer: guard packages check
Source: GitHub Advisory Database (reviewed advisories) · CC BY 4.0