Логотип exploitDog
Консоль
Логотип exploitDog

exploitDog

github логотип

GHSA-xg2h-wx96-xgxr

Опубликовано: 21 мая 2021
Источник: github
Github: Прошло ревью

Описание

RandomAlphaNumeric and CryptoRandomAlphaNumeric are not as random as they should be

Impact

A security-sensitive bug was discovered by Open Source Developer Erik Sundell of Sundell Open Source Consulting AB.

The functions RandomAlphaNumeric(int) and CryptoRandomAlphaNumeric(int) are not as random as they should be. Small values of int in the functions above will return a smaller subset of results than they should. For example, RandomAlphaNumeric(1) will always return a digit in the 0-9 range, while RandomAlphaNumeric(4) will return around ~7 million of the ~13M possible permutations.

This is considered a security release because programs that rely upon random generators for passwords are at an increased risk of brute force-style password guessing. There is also a higher probability of collision.

The problem was the result of a mistaken regular expression that only accepted random strings if they contained a digit from [0-9]. That restriction has been removed.

Patches

This issue has been corrected in v1.1.1.

Workarounds

If you cannot upgrade to v1.1.1, you can work around the issue by calling RandomAlphaNumericCustom(N, true, true)|CryptoRandomAlphaNumericCustom(N, true, true) instead. (Where N is the desired length, and true is the literal boolean true.)

Пакеты

Наименование

github.com/Masterminds/goutils

go
Затронутые версииВерсия исправления

< 1.1.1

1.1.1

EPSS

Процентиль: 57%
0.00348
Низкий

Дефекты

CWE-331

Связанные уязвимости

CVSS3: 9.1
ubuntu
около 3 лет назад

Randomly-generated alphanumeric strings contain significantly less entropy than expected. The RandomAlphaNumeric and CryptoRandomAlphaNumeric functions always return strings containing at least one digit from 0 to 9. This significantly reduces the amount of entropy in short strings generated by these functions.

CVSS3: 7
redhat
около 3 лет назад

Randomly-generated alphanumeric strings contain significantly less entropy than expected. The RandomAlphaNumeric and CryptoRandomAlphaNumeric functions always return strings containing at least one digit from 0 to 9. This significantly reduces the amount of entropy in short strings generated by these functions.

CVSS3: 9.1
nvd
около 3 лет назад

Randomly-generated alphanumeric strings contain significantly less entropy than expected. The RandomAlphaNumeric and CryptoRandomAlphaNumeric functions always return strings containing at least one digit from 0 to 9. This significantly reduces the amount of entropy in short strings generated by these functions.

CVSS3: 9.1
msrc
больше 1 года назад

Описание отсутствует

CVSS3: 9.1
debian
около 3 лет назад

Randomly-generated alphanumeric strings contain significantly less ent ...

EPSS

Процентиль: 57%
0.00348
Низкий

Дефекты

CWE-331