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.0p0 Hot Tips | CONFIDENTIAL | CodeSecure Inc |
暗号化されずに保存されたパスワードが、認証に使用されています。
| クラス名 | Plaintext Storage of Password | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | 平文で保存されたパスワード | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| クラス分類 | セキュリティ (security) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ニーモニック | MISC.PWD.PLAIN | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Plaintext Storage of Password" |
#include <stdio.h>
#include <windows.h>
#include <sqltypes.h>
#include <sqlext.h>
void setup_connection(SQLCHAR *server_name, FILE *nmpasswd ){
RETCODE rc;
HENV henv;
HDBC hdbc;
HSTMT hstmt;
SQLCHAR uname[16];
SQLCHAR passwd[32];
if (fgets(uname, 16, nmpasswd) == NULL ) return;
if (fgets(passwd, 32, nmpasswd) == NULL ) return;
SQLAllocEnv(&henv);
SQLAllocConnect(henv, &hdbc);
if( !hdbc ) abort();
rc = SQLConnectA(hdbc, /* Plaintext Storage of Password warning issued here */
server_name, SQL_NTS,
uname, 16,
passwd, 32);
/* ... */
exit(0);
}
SQLConnectA() へのパスワードの引数がファイルからの取得ではなく、 プログラム内でリテラル文字列として設定されている場合、代わりにハードコードされた認証値 (Hardcoded Authentication) ワーニングを検出します。
CodeSonar ships with library models that allow it to functions such as Win32 LogonUserA()/LogonUserW() that can use a password for authentication. If one of these functions is called with a potentially-cleartext-stored value in the password parameter position, a warning will be issued.
If you have created a custom library model for some function f() in terms of one of these existing models, calls to f() will also be capable of triggering Plaintext Storage of Password warnings.
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。