1
0
Fork 0
forked from svrjs/svrjs

Mitigate log file injection vulnerability at mod file names.

This commit is contained in:
Dorian Niemiec 2024-01-14 19:00:27 +01:00
parent e1e9338806
commit db6c4faeaf

2
svr.js
View file

@ -4886,7 +4886,7 @@ function start(init) {
// Display mod and server-side JavaScript errors // Display mod and server-side JavaScript errors
if (process.isPrimary || process.isPrimary === undefined) { if (process.isPrimary || process.isPrimary === undefined) {
modLoadingErrors.forEach(function (modLoadingError) { modLoadingErrors.forEach(function (modLoadingError) {
serverconsole.locwarnmessage("There was a problem while loading a \"" + modLoadingError.modName + "\" mod."); serverconsole.locwarnmessage("There was a problem while loading a \"" + String(modLoadingError.modName).replace(/[\r\n]/g, "") + "\" mod.");
serverconsole.locwarnmessage("Stack:"); serverconsole.locwarnmessage("Stack:");
serverconsole.locwarnmessage(generateErrorStack(modLoadingError.error)); serverconsole.locwarnmessage(generateErrorStack(modLoadingError.error));
}); });