CWE-1077
Weakness AllowedFloating Point Comparison with Incorrect Operator
Abstraction: Variant · Status: Incomplete
The code performs a comparison such as an equality test between two float (floating point) values, but it uses comparison operators that do not account for the possibility of loss of precision.
Technical nuance
Numeric calculation using floating point values can generate imprecise results because of rounding errors. As a result, two different calculations might generate numbers that are mathematically equal, but have slightly different bit representations that do not translate to the same mathematically-equal values. As a result, an equality test or other comparison might produce unexpected results.
Dimensions
- Behavior-Type: Floating Point Comparison
- Code-Type: Operator
- Code-Property: Incorrect
Mapping guidance
This CWE entry is at the Variant level of abstraction, which is a preferred level of abstraction for mapping to the root causes of vulnerabilities.
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.
Modes of introduction
Detection methods
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.)
Content history
Entry derived from Common Quality Enumeration (CQE) Draft 0.9.
updated Relationships
updated Description
updated Relationships
updated Mapping_Notes
updated Applicable_Platforms, Common_Consequences, Description, Detection_Factors, Time_of_Introduction
updated Description, Dimensions, References, Relationships, Technical_Nuance
12 vulnerabilities reference this CWE, most recent first.
GHSA-Q6RG-P2V8-VMP5
Vulnerability from github – Published: 2023-09-01 18:30 – Updated: 2023-09-01 18:30Floating Point Comparison with Incorrect Operator in GitHub repository gpac/gpac prior to 2.3-DEV.
{
"affected": [],
"aliases": [
"CVE-2023-4720"
],
"database_specific": {
"cwe_ids": [
"CWE-1077"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-09-01T16:15:08Z",
"severity": "MODERATE"
},
"details": "Floating Point Comparison with Incorrect Operator in GitHub repository gpac/gpac prior to 2.3-DEV.",
"id": "GHSA-q6rg-p2v8-vmp5",
"modified": "2023-09-01T18:30:41Z",
"published": "2023-09-01T18:30:41Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-4720"
},
{
"type": "WEB",
"url": "https://github.com/gpac/gpac/commit/e396648e48c57e2d53988d3fd4465b068b96c89a"
},
{
"type": "WEB",
"url": "https://huntr.dev/bounties/1dc2954c-8497-49fa-b2af-113e1e9381ad"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:L/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-RM4W-CFGF-329J
Vulnerability from github – Published: 2026-08-20 00:35 – Updated: 2026-08-20 00:35A flaw has been found in mruby 3.1.0. Affected is the function udiv of the file bigint.c. Executing a manipulation can lead to floating point comparison with incorrect operator. It is possible to launch the attack remotely. The exploit has been published and may be used. It is best practice to apply a patch to resolve this issue.
{
"affected": [],
"aliases": [
"CVE-2022-4996"
],
"database_specific": {
"cwe_ids": [
"CWE-1077"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-08-20T00:16:50Z",
"severity": "MODERATE"
},
"details": "A flaw has been found in mruby 3.1.0. Affected is the function udiv of the file bigint.c. Executing a manipulation can lead to floating point comparison with incorrect operator. It is possible to launch the attack remotely. The exploit has been published and may be used. It is best practice to apply a patch to resolve this issue.",
"id": "GHSA-rm4w-cfgf-329j",
"modified": "2026-08-20T00:35:11Z",
"published": "2026-08-20T00:35:10Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-4996"
},
{
"type": "WEB",
"url": "https://huntr.com/bounties/5a5092df-1699-4497-a8b2-38318bce0c4e"
},
{
"type": "WEB",
"url": "https://vuldb.com/cve/CVE-2022-4996"
},
{
"type": "WEB",
"url": "https://vuldb.com/submit/877513"
},
{
"type": "WEB",
"url": "https://vuldb.com/vuln/391391"
},
{
"type": "WEB",
"url": "https://vuldb.com/vuln/391391/cti"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
No mitigation information available for this CWE.
No CAPEC attack patterns related to this CWE.