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 |
名前でライブラリを認識するライブラリ命令は、名前の文字列が汚染されている可能性があります。
| クラス名 | Library Injection | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | ライブラリインジェクション | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| クラス分類 | セキュリティ (security) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ニーモニック | IO.INJ.LIB | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| カテゴリー |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 有効/無効設定 | このワーニングクラスのチェックはデフォルトで有効になっています。チェックを無効にするにはプロジェクト設定ファイル
(configuration file)に以下の WARNING_FILTER ルールを追加してください。
WARNING_FILTER += discard class="Library Injection" |
#include <stdio.h>
#include <string.h>
#include <unistd.h>
int uselib(const char *library);
int load_mylib(void){
int ret;
char libpath[256];
ret = uselib("/lib/mylib.so.2");
if (!ret) return 0;
ret = uselib("/usr/lib/mylib.so.2");
if (!ret) return 0;
printf("Could not find mylib: please enter location");
if (!fgets(libpath, 128, stdin)) return -1;
return uselib(strcat(libpath, "mylib.so.2")); /* 'Library Injection' warning issued here */
}
CodeSonar ships with library models that allow it to functions such as libc dlopen() and Win32 LoadLibraryA() that take a library name parameter. If one of these functions is called with a tainted value in the library name 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 Library Injection warnings.
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。
To report problems with this documentation, please visit https://support.codesecure.com/.