swift.insecure-random

返回列表 · CWE 索引

swiftWARNING规则详情

各语言消息对照

语言消息
de

Ein Zufallszahlengenerator wurde erkannt, der **nicht** *garantiert* kryptografisch sicher ist. Dient die Entropiequelle Sicherheitszwecken (etwa zusammen mit anderen kryptografischen Operationen), verwenden Sie ausdrücklich die API `SecCopyRandomBytes`.

en

A random number generator was detected which is **not** *guaranteed* to be Cryptographically secure. If the source of entropy is used for security purposes (e.g. with other Cryptographic operations), make sure to use the `SecCopyRandomBytes` API explicitly.

fr

Un générateur de nombres aléatoires **non garanti** comme cryptographiquement sûr a été détecté. Si cette source d'aléa sert à des fins de sécurité (par exemple avec d'autres opérations cryptographiques), utilisez explicitement l'API `SecCopyRandomBytes`.

ja

検出された乱数生成器は、暗号学的な安全性を**保証しません**。このエントロピーソースをセキュリティに関わる用途(他の暗号操作との組み合わせなど)に使用する場合は、`SecCopyRandomBytes` API を明示的に使用してください。

ko

감지된 난수 생성기는 암호학적 안전성을 **보장하지 않습니다**. 이 엔트로피 소스를 보안 용도(다른 암호학적 작업과의 조합 등)로 사용하는 경우에는 `SecCopyRandomBytes` API를 명시적으로 사용하십시오.

ru

Обнаружен генератор случайных чисел, криптостойкость которого **не гарантирована**. Если источник энтропии используется в задачах безопасности (например, вместе с другими криптографическими операциями), явно используйте API `SecCopyRandomBytes`.

zh

检测到的随机数生成器**不保证**密码学安全。若该熵源用于安全用途(如配合其他密码学操作),请显式使用 `SecCopyRandomBytes` API。

zh-Hant

檢測到的亂數產生器**不保證**密碼學安全。若該熵源用於安全用途(如配合其他密碼學操作),請顯式使用 `SecCopyRandomBytes` API。

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

元数据

likelihoodLOW
impactLOW
confidenceLOW

修复字段

fix无
fix-regex无

上游规则源

github.com/opengrep/opengrep-rules/tree/main/swift/lang/crypto/insecure-random.yaml