mirror of
https://github.com/verdaccio/verdaccio.git
synced 2024-12-16 21:56:25 -05:00
Fix redos vulnerability
This commit is contained in:
parent
d12a6fdb1e
commit
77c67e674b
1 changed files with 1 additions and 1 deletions
|
@ -8,7 +8,7 @@ import { URL } from 'url';
|
|||
* @returns {String}
|
||||
*/
|
||||
export function getVersionFromTarball(fileName: string): string | void {
|
||||
const groups = fileName.match(/^.+-(\d+\.\d+\.\d+.+)\.tgz$/);
|
||||
const groups = fileName.replace(/\.tgz$/, '').match(/^[^/]+-(\d+\.\d+\.\d+.*)/);
|
||||
|
||||
return groups !== null ? groups[1] : undefined;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue