mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-05-23 16:20:35 -04:00
Merge pull request #1647 from npt-1707/fix_CVE-2022-24785
Fix potentially vulnerable cloned function
This commit is contained in:
@@ -1842,11 +1842,16 @@
|
||||
return globalLocale;
|
||||
}
|
||||
|
||||
function isLocaleNameSane(name) {
|
||||
// Prevent names that look like filesystem paths, i.e contain '/' or '\'
|
||||
return name.match('^[^/\\\\]*$') != null;
|
||||
}
|
||||
|
||||
function loadLocale(name) {
|
||||
var oldLocale = null;
|
||||
// TODO: Find a better way to register and load all the locales in Node
|
||||
if (!locales[name] && (typeof module !== 'undefined') &&
|
||||
module && module.exports) {
|
||||
module && module.exports && isLocaleNameSane(name)) {
|
||||
try {
|
||||
oldLocale = globalLocale._abbr;
|
||||
var aliasedRequire = require;
|
||||
|
||||
Reference in New Issue
Block a user