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 予防
この脆弱性の修正方法
Python
すべて表示 Python 詳細 →
JWT Signed with Weak Secret
HIGH
Use strong secrets from environment variables for JWT signing, never hardcode
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
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 .
検出ルール (2)
🐍
Python
2 rules
JWT Signed with Weak Secret
HIGH
Detects JWT tokens signed with weak, hardcoded, or default secret keys that can be brute-forced.
Weak Cryptographic Key Generation
HIGH
Detects weak cryptographic key generation: insufficient key sizes, predictable
keys, or using weak algorithms. Cryptographic keys must be sufficiently long
and generated with secure random sources.
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 はコードベース全体から脆弱なパターンを見つけます。