Common Weakness Enumeration

CWE-1077

Weakness Allowed

Floating 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.

Relationships and members
ChildOf: CWE-480 · View CWE-1000
ChildOf: CWE-697 · View CWE-1000
Modes of introduction
Implementation
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
Submission: CWE Content Team · MITRE · 2018-07-02 · CWE 3.2

Entry derived from Common Quality Enumeration (CQE) Draft 0.9.

Modification: CWE Content Team · MITRE · 2020-08-20 · CWE 4.2

updated Relationships

Modification: CWE Content Team · MITRE · 2023-01-31 · CWE 4.10

updated Description

Modification: CWE Content Team · MITRE · 2023-04-27 · CWE 4.11

updated Relationships

Modification: CWE Content Team · MITRE · 2023-06-29 · CWE 4.12

updated Mapping_Notes

Modification: CWE Content Team · MITRE · 2025-12-11 · CWE 4.19

updated Applicable_Platforms, Common_Consequences, Description, Detection_Factors, Time_of_Introduction

Modification: CWE Content Team · MITRE · 2026-10-28 · CWE 5.0

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:30
VLAI
Details

Floating Point Comparison with Incorrect Operator in GitHub repository gpac/gpac prior to 2.3-DEV.

Show details on source website

{
  "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:35
VLAI
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.

Show details on source website

{
  "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.