ベータ Shoulder はベータ版です — 結果が誤っている場合があります。皆さまのフィードバックが次に修正する内容を決定します。 フィードバックを送る
🔒

Inadequate Encryption Strength

🛡️ 2 件のルールが検出します

Inadequate Encryption Strength

The product stores or transmits sensitive data using an encryption scheme that is theoretically sound, but is not strong enough for the level of protection required.

Using encryption with insufficient key lengths or deprecated algorithms provides a false sense of security. Attackers with sufficient resources can break weak encryption.

普及度
1 言語をカバー
影響度
ハイ
2 件の重大度ハイのルール
予防
文書化済み
2 件の修正例
2 予防
2 予防

この脆弱性の修正方法

JWT Signed with Weak Secret HIGH

Use strong secrets from environment variables for JWT signing, never hardcode

+6 -3 python
  import jwt
- 
- def create_token(user_id):
-     return jwt.encode({'user_id': user_id}, 'secret', algorithm='HS256')
+ import os
+ 
+ SECRET_KEY = os.environ['JWT_SECRET_KEY']
+ 
+ def create_token(user_id):
+     return jwt.encode({'user_id': user_id}, SECRET_KEY, algorithm='HS256')
  
Weak Cryptographic Key Generation HIGH

Use RSA 2048+ bits or AES-256 with cryptographically secure key generation

+1 -1 python
  from Crypto.PublicKey import RSA
  
- key = RSA.generate(1024)
+ key = RSA.generate(2048)
  
3 検出
3 検出

コードの脆弱性を見つける

Shoulderを使用してコードのInadequate Encryption Strengthパターンをスキャンしましょう。 2 ルール.

ターミナル
# Scan with Shoulder CLI
npx @shoulderdev/cli trust --cwe=326

# Or scan entire project
npx @shoulderdev/cli trust .
4 警告サイン
4 警告サイン

コードレビューで注目すべき点

これらのパターンはInadequate Encryption Strengthの潜在的な脆弱性を示しています。コードレビューとセキュリティ監査中に探してください。

🟠
JWT tokens signed with weak, hardcoded, or default secret keys that can be brute-forced python-jwt-weak-secret
🟠
weak cryptographic key generation: insufficient key sizes, predictable keys, or using weak algorithm python-weak-key-generation
🔍

コードベースをスキャン: Inadequate Encryption Strength

Shoulder CLI はコードベース全体から脆弱なパターンを見つけます。