Skip to content
Heist/ feed
Back to feed
Medium

Loop with Unreachable Exit Condition in GNU patch

Type: advisorySources: OSV

GNU patch is vulnerable to a denial of service (DoS) due to improper validation of hunk (single block of changes in diff) line offsets in unified-diff input. A specially crafted patch can specify an extremely large line number, causing the application to enter an effectively infinite processing loop while attempting to locate the requested position. This results in excessive CPU consumption and prevents the process from completing. An attacker can trigger this behavior by supplying a malicious patch file, causing the utility to become unresponsive and require manual termination. This issue has been fixed in the commit faba04ef4f2b410257f76c1b9dc85e350929c4b9

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2026-56289
Confirmed fixed CVEs
Not specified
Updated in this feed
1 Nov 2026, 17:13 UTC · Revision 1

Source evidence

Loop with Unreachable Exit Condition in GNU patch

core-osv · Original source

Published 9 Jul 2026, 09:29 UTC

GNU patch is vulnerable to a denial of service (DoS) due to improper validation of hunk (single block of changes in diff) line offsets in unified-diff input. A specially crafted patch can specify an extremely large line number, causing the application to enter an effectively infinite processing loop while attempting to locate the requested position. This results in excessive CPU consumption and prevents the process from completing. An attacker can trigger this behavior by supplying a malicious patch file, causing the utility to become unresponsive and require manual termination. This issue has been fixed in the commit faba04ef4f2b410257f76c1b9dc85e350929c4b9

osv:CVE-2026-56289
Complete source record
{
  "id": "6c85a03a260589b30dc3056e015c091aee26f019f5d15def8998084c244952a9",
  "url": "https://osv.dev/vulnerability/CVE-2026-56289",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Loop with Unreachable Exit Condition in GNU patch",
    "summary": "GNU patch is vulnerable to a denial of service (DoS) due to improper validation of hunk (single block of changes in diff) line offsets in unified-diff input. A specially crafted patch can specify an extremely large line number, causing the application to enter an effectively infinite processing loop while attempting to locate the requested position. This results in excessive CPU consumption and prevents the process from completing. An attacker can trigger this behavior by supplying a malicious patch file, causing the utility to become unresponsive and require manual termination. This issue has been fixed in the commit faba04ef4f2b410257f76c1b9dc85e350929c4b9",
    "evidence": "osv:CVE-2026-56289",
    "products": [],
    "severity": "medium",
    "structured": {
      "id": "CVE-2026-56289",
      "aliases": [
        "CVE-2026-56289"
      ],
      "metrics": [
        {
          "type": "CVSS_V4",
          "score": "CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:N/VI:N/VA:L/SC:N/SI:N/SA:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://cgit.git.savannah.gnu.org/cgit/patch.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "faba04ef4f2b410257f76c1b9dc85e350929c4b9"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "range": [
                      {
                        "fixed": "faba04ef4f2b410257f76c1b9dc85e350929c4b9"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-56289.json"
          }
        }
      ],
      "modified": "2026-10-31T10:30:48.464879965Z",
      "provider": "osv",
      "references": [
        "https://cgit.git.savannah.gnu.org/cgit/patch.git/",
        "https://cert.pl/en/posts/2026/07/CVE-2026-56288",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/56xxx/CVE-2026-56289.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2026-56289",
        "https://cgit.git.savannah.gnu.org/cgit/patch.git/commit/?id=faba04ef4f2b410257f76c1b9dc85e350929c4b9"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-835"
        ],
        "cna_assigner": "CERT-PL",
        "unresolved_ranges": [
          {
            "extracted_events": [
              {
                "range": [
                  {
                    "last_affected": "2.8.0"
                  }
                ],
                "source": "AFFECTED_FIELD",
                "strategy": "StandardRange"
              }
            ]
          }
        ],
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/56xxx/CVE-2026-56289.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-56289",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 460111,
  "published_at": "2026-07-09T09:29:22.467+00:00"
}