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 |
システム生成された時間が、システム生成されていない (したがって、汚染されている若しくは怪しいと疑われる)時間と比較されています。 このような比較は、潜在的にタイムボム(特定の絶対時間か相対時間でのみ 実行される振る舞いのこと)を引き起こす可能性があります。
| クラス名 | Potential Timebomb | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 日本語クラス名 | タイムボムの可能性 | ||||||||||||||||||
| クラス分類 | スタイル (style) | ||||||||||||||||||
| ニーモニック | MISC.TIMEBOMB | ||||||||||||||||||
| カテゴリー |
|
||||||||||||||||||
| 対応言語 | C および C++ で利用可能です。 |
||||||||||||||||||
| 有効/無効設定 | Checks for this warning class are
disabled by default, and it tracks 'time' taint which
is also disabled by default. To enable the checks,
make the following changes to the project configuration file.
|
#include <time.h>
void misc_timebomb(void){
time_t deadline = 1893456000;
time_t now = time(NULL);
if (now > time(NULL)){ /* ok: time value compared against another time value */
return;
}
if (now < deadline){ /* 'Potential Timebomb' warning issued: time value compared against non-time value */
return;
}
/* An inside attacker could put malicious code here:
* it would only be executed once the deadline was past. */
}
CodeSonar ships with library models that allow it to recognize a functions such as libc mktime() and Win32 GetTickCount() that produce system time values by returning such values, writing them through an argument pointer, or both.
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 treated as producing system time values under the same circumstances.
設定ファイルの以下のパラメータがこのワーニングクラスのチェックに影響します。