-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add safeguard against CVE-2024-21528
- Loading branch information
Showing
6 changed files
with
35 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
/** | ||
* This module is a basic placeholder stopfix for CVE-2024-21528 in `node-gettext`. | ||
* There is currently no patched version available, once a fix is published, please update `node-gettext` and remove | ||
* this module and other changes introduced by this commit. | ||
*/ | ||
// eslint-disable-next-line no-restricted-imports | ||
import RawGettext from "node-gettext"; | ||
|
||
export default class Gettext extends RawGettext { | ||
addTranslations(locale: string, domain: string, translations: Record<string | symbol, unknown>) { | ||
if (String(locale) === "__proto__") { | ||
throw new RangeError("Invalid locale"); | ||
} | ||
if (String(domain) === "__proto__") { | ||
throw new RangeError("Invalid domain"); | ||
} | ||
return super.addTranslations.call(this, locale, domain, translations); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Add safeguard against CVE-2024-21528 |