Advisories for Npm/@Saltcorn/Server package

2024

@saltcorn/server Remote Code Execution (RCE) / SQL injection via prototype pollution by manipulating `lang` and `defstring` parameters when setting localizer strings

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: RCE vulnerabilities by polluting the tempRootFolder property SQL injection vulnerabilities by polluting the schema property when using PostgreSQL database.