JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++
Binaries


HARDCODED.AUTH : ハードコードされた認証値

要旨

認証文字列が引き渡される関数に、ハードコードされた文字列が渡されています。

プロパティ

クラス名 Hardcoded Authentication
日本語クラス名 ハードコードされた認証値
クラス分類 セキュリティ (security)
ニーモニック HARDCODED.AUTH
カテゴリー
CWE CWE:259 Use of Hard-coded Password
  CWE:318 Cleartext Storage of Sensitive Information in Executable
  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
DISA-6r1 DISA-6r1:V-222642 The application must not contain embedded authentication data.
DISA-5r3 DISA-5r3:V-70363 The application must not contain embedded authentication data.
DISA-4r3 DISA-4r3:V-70363 The application must not contain embedded authentication data.
DISA-3r10 DISA-3r10:V-6156 The designer will ensure the application does not contain embedded authentication data.
OWASP-2017 OWASP-2017:A2 Broken authentication
  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
OWASP-2025 OWASP-2025:A01 Broken Access Control
  OWASP-2025:A02 Security Misconfiguration
  OWASP-2025:A07 Authentication Failures
対応言語 C および C++ で利用可能です。
有効/無効設定 このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル (configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Hardcoded Authentication"

#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include <sqltypes.h>
#include <sqlext.h>
#include <sys/socket.h>

void setup_connection_hc(SQLCHAR *server_name, FILE *nmpasswd )
{
   HENV henv; 
   HDBC hdbc; 
   HSTMT hstmt;

   SQLAllocEnv(&henv);
   if( SQLAllocConnect(henv, &hdbc) == SQL_SUCCESS )
       (void)SQLConnectA(hdbc, /* Hardcoded Authentication warning issued here */
                         server_name, SQL_NTS, 
                         "alex",  SQL_NTS, 
                         "hunter2", SQL_NTS);
   // ...
   exit(0);
}

注釈

このクラスは一般テンプレート設定ファイル(general template configuration file)の HARDCODED_ARGS_* ルールにて定義され、認証値と引数とする多くの関数をサポートしています。 全ての関数リストは HARDCODED_ARGS_* の "Factory Settings" を参照してください。

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

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

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

 

To report problems with this documentation, please visit https://support.codesecure.com/.