CWE一覧に戻る
CWE-1339

実数の精度または正確さの不足

Insufficient Precision or Accuracy of a Real Number
脆弱性 レビュー中
JA

この積は、実数を処理する実装で、その数値の表現が分数部分に必要な精度と正確さを保持しないため、不正確な結果を引き起こす。

セキュリティ上の判断や計算が、財務計算や価格など、非常に精密で正確な数値を必要とする場合、その数値のわずかな変動が攻撃者に悪用される可能性がある。

実数の小数部分をコンピュータに保存する方法は複数ある。いずれの場合も、分数の記録精度には限界がある。分数が決まった桁数(2進数または10進数)で表現できる場合、その数を表現するのに十分な桁数が割り当てられない可能性がある。また、10進数や2進数表記(例:0.333333...)で繰り返したり、Πや√2のような超越的な数のために、一定の桁数で表すことができない場合もある。数値の丸めは、コンピュータの結果が十分に正確な数学の結果と十分に一致しない状況につながる可能性がある。

EN

The product processes a real number with an implementation in which the number's representation does not preserve required accuracy and precision in its fractional part, causing an incorrect result.

When a security decision or calculation requires highly precise, accurate numbers such as financial calculations or prices, then small variations in the number could be exploited by an attacker.

There are multiple ways to store the fractional part of a real number in a computer. In all of these cases, there is a limit to the accuracy of recording a fraction. If the fraction can be represented in a fixed number of digits (binary or decimal), there might not be enough digits assigned to represent the number. In other cases the number cannot be represented in a fixed number of digits due to repeating in decimal or binary notation (e.g. 0.333333...) or due to a transcendental number such as Π or √2. Rounding of numbers can lead to situations where the computer results do not adequately match the result of sufficiently accurate math.

Scope: Availability / Impact: DoS: Crash, Exit, or Restart
Scope: Integrity / Impact: Execute Unauthorized Code or Commands
Scope: Confidentiality, Availability, Access Control / Impact: Read Application Data; Modify Application Data
The developer or maintainer can move to a more accurate representation of real numbers. In extreme cases, the programmer can move to representations such as ratios of BigInts which can represent real numbers to extremely fine precision. The programmer can also use the concept of an Unum real. The memory and CPU tradeoffs of this change must be examined. Since floating point reals are used in many products and many locations, they are implemented in hardware and most format changes will cause the calculations to be moved into software resulting in slower products.
MITRE公式ページ — CWE-1339