GHSA-pf56-h9qf-rxq4: Saltcorn Server Stored Cross-Site Scripting (XSS) in event logs page
Summary Event log data is not properly sanitized leading to stored Cross-Site Scripting (XSS) vulnerability. Details - file: https://github.com/saltcorn/saltcorn/blob/v1.0.0-beta.13/packages/server/routes/eventlog.js#L445 PoC The following PoC demonstrates how a non-admin user with permission to read/write on a table can inject malicious javascript code that will be executed in the event log admin panel if event…
Published Oct 7, 2024
Affected packages
@saltcorn/server
- Ecosystem
- npm
- Affected
- < 1.0.0-beta.16
- Fixed in
- 1.0.0-beta.16
- Check
npm ls @saltcorn/server
Advisory details
From the GitHub Advisory Database (CC BY 4.0).
Summary
Event log data is not properly sanitized leading to stored Cross-Site Scripting (XSS) vulnerability.
Details
- file: https://github.com/saltcorn/saltcorn/blob/v1.0.0-beta.13/packages/server/routes/eventlog.js#L445
router.get(
"/:id",
isAdmin,
error_catcher(async (req, res) => {
const { id } = req.params;
const ev = await EventLog.findOneWithUser(id);
send_events_page({
[...]
contents: {
type: "card",
contents:
[...]
) +
div(
{ class: "eventpayload" },
ev.payload ? pre(JSON.stringify(ev.payload, null, 2)) : "" //<---
),
},
});
})
PoC
The following PoC demonstrates how a non-admin user with permission to read/write on a table can inject malicious javascript code that will be executed in the event log admin panel if event logs are enabled.
To demonstrate this issue, we need to prepare some components. The following steps should be executed with an admin user.
- create a table with one column of type string set read/write permission to staff users (just as an example)
- visit
http://localhost:3000/table/new - create a table with
Table namemy_table_xssand clickCreate - click
Add fieldto add a field withLabelcalledpayloadof typeStringand clickNext >> - leave default values for
Attributesand clickNext >>- it should redirect tohttp://localhost:3000/table/<table-number> - under
Edit table properties, setMinimum role to readandMinimum role to writetostaff
- create an edit view so that staff users can insert more data
- visit
http://localhost:3000/vieweditanc clickCreate View - set the following values:
View name:my_xss_viewView pattern:EditTable:my_table_xssMinimum role:staff- click
Configure >> - on page
http://localhost:3000/viewedit/config/my_xss_viewclickNext >>and thenFinish >> - you should see a message
View my_xss_view saved
- edit the site structure to add the View just created so that
staffusers can access it - visit
http://localhost:3000/menu - set the following values:
Type:ViewView:my_xss_view [Edit]Text label:viewMinimum role:staff- click
Add
- create an event that will log when data is inserted in the
my_table_xsstable create at step 1 - visit
http://localhost:3000/eventlog/settings - under
Which events should be logged?select: [X] Insert[X] Insert my_table_xss
Login with a user with staff role (you can do the same steps also with an admin user)
- visit
http://localhost:3000/view/my_xss_view - in the
payloadfield insert `"<svg/onload=alert(xss)>and clickSave`
With an admin user inspect the log entry generated by the above action:
- visit
http://localhost:3000/eventlog - click on the event log generated (
http://localhost:3000/eventlog/<event-number>) - an alert will appear
Impact
Stored Cross-Site Scripting (XSS)
Recommended Mitigation
Sanitize the user input before building HTML elements
Credited to dellalibera.
References
- https://github.com/saltcorn/saltcorn/security/advisories/GHSA-pf56-h9qf-rxq4
- https://github.com/saltcorn/saltcorn/commit/3c551261d0e230635774798009951fa83a07cc3a
- https://github.com/saltcorn/saltcorn/blob/v1.0.0-beta.13/packages/server/routes/eventlog.js#L445
- https://github.com/advisories/GHSA-pf56-h9qf-rxq4
How this page is made: the data panel comes from the GitHub Advisory Database, CISA’s KEV catalog, the NVD and FIRST EPSS, and updates twice a day. No analysis has been written for this entry yet. Methodology
More npm vulnerabilities
All npm entriesCVE-2026-41478
Saltcorn: SQL Injection via Unparameterized Sync Endpoints (maxLoadedId)
critical9.9Apr 16, 2026CVE-2026-42259
Saltcorn: Open Redirect in `POST /auth/login` due to incomplete `is_relative_url` validation (backslash bypass)
medium5.1Apr 16, 2026CVE-2026-40163
Saltcorn has an Unauthenticated Path Traversal in sync endpoints, allowing arbitrary file write and directory read
high8.2Apr 10, 2026GHSA-cr3w-cw5w-h3fj
Saltcorn's Reflected XSS and Command Injection vulnerabilities can be chained for 1-click-RCE
critical9.6Jan 26, 2026CVE-2024-47818
Saltcorn Server allows logged-in users to delete arbitrary files because of a path traversal vulnerability
high6.5Oct 7, 2024GHSA-277h-px4m-62q8
@saltcorn/server arbitrary file zip read and download when downloading auto backups
medium4.4Oct 3, 2024
