Security
Headlines
HeadlinesLatestCVEs

Headline

CVE-2023-34109: fix(user-inputs): resolve memory leak with user inputs on the fly · zxcvbn-ts/zxcvbn@3f9bed2

zxcvbn-ts is an open source password strength estimator written in typescript. This vulnerability affects users running on the nodeJS platform which are using the second argument of the zxcvbn function. It can result in an unbounded resource consumption as the user inputs array is extended with every function call. Browsers are impacted, too but a single user need to do a lot of input changes so that it affects the browser, while the node process gets the inputs of every user of a platform and can be killed that way. This problem has been patched in version 3.0.2. Users are advised to upgrade. Users unable to upgrade should stop using the second argument of the zxcvbn function and use the zxcvbnOptions.setOptions function.

CVE
#vulnerability#nodejs#js

Expand Up @@ -112,16 +112,16 @@ export class Options { const rankedDictionaries: RankedDictionaries = {} const rankedDictionariesMaxWorkSize: Record<string, number> = {} Object.keys(this.dictionary).forEach((name) => { rankedDictionaries[name] = this.getRankedDictionary(name) rankedDictionaries[name] = buildRankedDictionary(this.dictionary[name]) rankedDictionariesMaxWorkSize[name] = this.getRankedDictionariesMaxWordSize(name) this.getRankedDictionariesMaxWordSize(this.dictionary[name]) }) this.rankedDictionaries = rankedDictionaries this.rankedDictionariesMaxWordSize = rankedDictionariesMaxWorkSize }
getRankedDictionariesMaxWordSize(name: string) { const data = this.dictionary[name].map((el) => { getRankedDictionariesMaxWordSize(list: (string | number)[]) { const data = list.map((el) => { if (typeof el !== ‘string’) { return el.toString().length } Expand All @@ -135,40 +135,33 @@ export class Options { return data.reduce((a, b) => Math.max(a, b), -Infinity) }
getRankedDictionary(name: string) { const list = this.dictionary[name] if (name === ‘userInputs’) { const sanitizedInputs: string[] = []
list.forEach((input: string | number | boolean) => { const inputType = typeof input if ( inputType === ‘string’ || inputType === ‘number’ || inputType === ‘boolean’ ) { sanitizedInputs.push(input.toString().toLowerCase()) } })
return buildRankedDictionary(sanitizedInputs) } return buildRankedDictionary(list) buildSanitizedRankedDictionary(list: (string | number)[]) { const sanitizedInputs: string[] = []
list.forEach((input: string | number | boolean) => { const inputType = typeof input if ( inputType === ‘string’ || inputType === ‘number’ || inputType === ‘boolean’ ) { sanitizedInputs.push(input.toString().toLowerCase()) } })
return buildRankedDictionary(sanitizedInputs) }
extendUserInputsDictionary(dictionary: (string | number)[]) { if (this.dictionary.userInputs) { this.dictionary.userInputs = [ …this.dictionary.userInputs, …dictionary, ] } else { this.dictionary.userInputs = dictionary if (!this.dictionary.userInputs) { this.dictionary.userInputs = [] }
this.rankedDictionaries.userInputs = this.getRankedDictionary(‘userInputs’) const newList = […this.dictionary.userInputs, …dictionary] this.rankedDictionaries.userInputs = this.buildSanitizedRankedDictionary(newList) this.rankedDictionariesMaxWordSize.userInputs = this.getRankedDictionariesMaxWordSize(‘userInputs’) this.getRankedDictionariesMaxWordSize(newList) }
public addMatcher(name: string, matcher: Matcher) { Expand Down

CVE: Latest News

CVE-2023-50976: Transactions API Authorization by oleiman · Pull Request #14969 · redpanda-data/redpanda