go.math-random-used

返回列表 · CWE 索引

goWARNING规则详情

各语言消息对照

语言消息
de

Verwenden Sie nicht `math/rand`, sondern `crypto/rand`.

en

Do not use `math/rand`. Use `crypto/rand` instead.

fr

N'utilisez pas `math/rand` ; utilisez `crypto/rand`.

ja

`math/rand` は使用しないでください。代わりに `crypto/rand` を使用してください。

ko

`math/rand` 대신 `crypto/rand`를 사용하십시오.

ru

Не используйте `math/rand` — используйте `crypto/rand`.

zh

请勿使用 `math/rand`,请改用 `crypto/rand`。

zh-Hant

請勿使用 `math/rand`,請改用 `crypto/rand`。

CWE 知识卡

语言名称修复建议
deSchwacher Zufallswert (Sicherheitszweck)Verwenden Sie in Sicherheitsszenarien einen CSPRNG (crypto.randomBytes/SecureRandom), nicht Math.random/rand.
en——
frUtilisation d'un générateur pseudo-aléatoire cryptographiquement faibleDans les scénarios de sécurité, utilisez un CSPRNG (crypto.randomBytes/SecureRandom) et non Math.random/rand.
ja弱い乱数(セキュリティ用途)セキュリティに関わる場面では CSPRNG(crypto.randomBytes/SecureRandom)を使用し、Math.random や rand は使用しないでください。
ko약한 난수(보안 용도)보안 시나리오에서는 CSPRNG(crypto.randomBytes/SecureRandom)를 사용하고, Math.random/rand는 사용하지 마십시오.
ruСлабое случайное число (в задачах безопасности)В защищённых сценариях используйте CSPRNG (crypto.randomBytes/SecureRandom), а не Math.random/rand.
zh弱随机数(安全用途)安全场景使用 CSPRNG(crypto.randomBytes/SecureRandom),不用 Math.random/rand。
zh-Hant弱亂數(安全用途)安全場景使用 CSPRNG(crypto.randomBytes/SecureRandom),不用 Math.random/rand。

OWASP

A02:2021 - Cryptographic Failures

元数据

likelihoodMEDIUM
impactMEDIUM
confidenceMEDIUM

修复字段

fix有
fix-regex无

上游规则源

github.com/opengrep/opengrep-rules/tree/main/go/lang/security/audit/crypto/math_random.yaml