Chi tiết CWE-1339

CWE-1339

Insufficient Precision or Accuracy of a Real Number
2021-07-20
00h00 +00:00
Draft
2026-10-28
00h00 +00:00
Thông báo cho một CWE
Luôn được thông báo về mọi thay đổi đối với một CWE cụ thể.
Quản lý thông báo

Tên: Insufficient Precision or Accuracy of a Real Number

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.

Thông tin chung

Chi tiết nền tảng

Các cách xuất hiện

Implementation : This weakness is introduced when the developer picks a method to represent a real number. The weakness may only be visible with very specific numeric inputs.

Nền tảng áp dụng

Ngôn ngữ

Lớp: Not Language-Specific (Undetermined)
Tên: Python (Undetermined)

Hệ điều hành

Lớp: Not OS-Specific (Undetermined)

Kiến trúc

Lớp: Not Architecture-Specific (Undetermined)

Công nghệ

Lớp: Not Technology-Specific (Undetermined)

Hậu quả phổ biến

Phạm vi Tác động Khả năng xảy ra
AvailabilityDoS: Crash, Exit, or Restart

Ghi chú: 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.
IntegrityExecute Unauthorized Code or Commands

Ghi chú: 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

Ghi chú: 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.

Ví dụ đã quan sát

Tài liệu tham khảo Mô tả

CVE-2018-16069

Chain: series of floating-point precision errors (CWE-1339) in a web browser rendering engine causes out-of-bounds read (CWE-125), giving access to cross-origin data

CVE-2017-7619

Chain: rounding error in floating-point calculations (CWE-1339) in image processor leads to infinite loop (CWE-835)

CVE-2021-29529

Chain: machine-learning product can have a heap-based buffer overflow (CWE-122) when some integer-oriented bounds are calculated by using ceiling() and floor() on floating point values (CWE-1339)

CVE-2008-2108

Chain: insufficient precision (CWE-1339) in random-number generator causes some zero bits to be reliably generated, reducing the amount of entropy (CWE-331).

CVE-2006-6499

Chain: web browser crashes due to infinite loop - "bad looping logic [that relies on] floating point math [CWE-1339] to exit the loop [CWE-835]"

Các biện pháp giảm thiểu tiềm năng

Phases : 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.

Phương pháp phát hiện

Automated Static Analysis

Automated static analysis, commonly referred to as Static Application Security Testing (SAST), can find some instances of this weakness by analyzing source code (or binary/compiled code) without having to execute it. Typically, this is done by building a model of data flow and control flow, then searching for potentially-vulnerable patterns that connect "sources" (origins of input) with "sinks" (destinations where the data interacts with external components, a lower layer such as the OS, etc.)

Ghi chú ánh xạ lỗ hổng

Lý do : This CWE entry is at the Base level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
Bình luận : Carefully read both the name and description to ensure that this mapping is an appropriate fit. Do not try to 'force' a mapping to a lower-level Base/Variant simply to comply with this preferred level of abstraction.

Tài liệu tham khảo

REF-1186

Is COBOL holding you hostage with Math?
https://medium.com/the-technical-archaeologist/is-cobol-holding-you-hostage-with-math-5498c0eb428b

REF-1187

Intermediate results and arithmetic precision
https://www.ibm.com/docs/en/cobol-zos/6.2?topic=appendixes-intermediate-results-arithmetic-precision

REF-1188

8.1.2. Arbitrary Precision Numbers
https://www.postgresql.org/docs/8.3/datatype-numeric.html#DATATYPE-NUMERIC-DECIMAL

REF-1189

Muller's Recurrence
https://scipython.com/blog/mullers-recurrence/

REF-1190

An Improvement To Floating Point Numbers
https://hackaday.com/2015/10/22/an-improvement-to-floating-point-numbers/

REF-1191

HIGH PERFORMANCE COMPUTING: ARE WE JUST GETTING WRONG ANSWERS FASTER?
https://www3.nd.edu/~markst/cast-award-speech.pdf

REF-1281

The sinking of the Sleipner A offshore platform
Douglas N. Arnold.
https://www-users.cse.umn.edu/~arnold/disasters/sleipner.html

REF-1541

Secure Coding Guide for Python
OpenSSF.
https://best.openssf.org/Secure-Coding-Guide-for-Python/

Gửi

Tên Tổ chức Ngày Ngày phát hành Version
CWE Content Team MITRE 2021-07-08 +00:00 2021-07-20 +00:00 4.5

Sửa đổi

Tên Tổ chức Ngày Bình luận
CWE Content Team MITRE 2022-10-13 +00:00 updated Demonstrative_Examples
CWE Content Team MITRE 2023-01-31 +00:00 updated Common_Consequences, Description, Potential_Mitigations
CWE Content Team MITRE 2023-04-27 +00:00 updated References, Relationships
CWE Content Team MITRE 2023-06-29 +00:00 updated Mapping_Notes
CWE Content Team MITRE 2024-02-29 +00:00 updated Demonstrative_Examples
CWE Content Team MITRE 2025-04-03 +00:00 updated Demonstrative_Examples
CWE Content Team MITRE 2025-12-11 +00:00 updated Detection_Factors, Weakness_Ordinalities
CWE Content Team MITRE 2026-10-28 +00:00 updated Applicable_Platforms, Background_Details, Demonstrative_Examples, Description, References, Relationships, Taxonomy_Mappings