C and C++ Binaries


HARDCODED.KEY : ハードコードされた暗号キー

要旨

暗号化されたキーが引き渡される関数に、ハードコードされた値が渡されています。

プロパティ

クラス名 Hardcoded Crypto Key
日本語クラス名 ハードコードされた暗号キー
クラス分類 セキュリティ (security)
ニーモニック HARDCODED.KEY
カテゴリー
CWE CWE:318 Cleartext Storage of Sensitive Information in Executable
  CWE:321 Use of Hard-coded Cryptographic Key
  CWE:540 Inclusion of Sensitive Information in Source Code
  CWE:547 Use of Hard-coded, Security-relevant Constants
  CWE:798 Use of Hard-coded Credentials
CERT-C CERT-C:MSC18-C Be careful while handling sensitive data, such as passwords, in program code
  CERT-C:MSC41-C Never hard code sensitive information
OWASP-2017 OWASP-2017:A5 Broken access control
  OWASP-2017:A6 Security misconfiguration
OWASP-2021 OWASP-2021:A1 Broken access control
  OWASP-2021:A5 Security misconfiguration
  OWASP-2021:A7 Identification and authorization failures
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Hardcoded Crypto Key"

#include <crypt.h>

void hardcoded_key(const char *p, const char *q){
    crypt("password", q); /* 'Hardcoded Crypto Key' warning issued here
                           * ('Use of crypt' warning also issued)
                           */
    crypt(p, q);                       /* ok: not hardcoded */
                          /* ('Use of crypt' warning issued here) */
}

注釈

このクラスは一般テンプレート設定ファイル(general template configuration file)の HARDCODED_ARGS_* ルールにて定義され、暗号化されたキーと引数とする多くの関数をサポートしています。

関連のある設定ファイルパラメータ

このクラスは一般テンプレート設定ファイルで HARDCODED_ARGS_* ルールセットによって実装されています。

設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。