BaseDraft

CWE-1339Insufficient Precision or Accuracy of a Real Number

Category: other

Description

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.

Common consequences· 3

  • Availability — DoS: Crash, Exit, or Restart
    This weakness will generally lead to undefined results and therefore crashes. In some implementations the program will halt if the weakness causes an overflow during a calculation.
  • Integrity — Execute Unauthorized Code or Commands
    The results of the math are not as expected. This could cause issues where a value would not be properly calculated and provide an incorrect answer.
  • Confidentiality / Availability / Access Control — Read Application Data, Modify Application Data
    This weakness can sometimes trigger buffer overflows which can be used to execute arbitrary code. This is usually outside the scope of a product's implicit security policy.

Potential mitigations· 1

  • [Implementation, Patching and Maintenance]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.

References

  1. https://cwe.mitre.org/data/definitions/1339.html

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Signed to Unsigned Conversion Error
CWE
Integer Overflow or Wraparound
CWE
Improper Validation of Specified Type of Input
CWE
Incorrect Parsing of Numbers with Different Radices
CWE
Improper Input Validation
CWE
Incorrect Type Conversion or Cast
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.