{
  "id": "CVE-2025-5987",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-5987",
  "published_at": "2025-07-07T14:24:12.576Z",
  "title": "Libssh: invalid return code for chacha20 poly1305 with openssl backend",
  "vendor": "Red Hat",
  "product": "Red Hat",
  "cvss": {
    "score": 8.1,
    "source": "cna",
    "vector": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "A flaw was found in libssh when using the ChaCha20 cipher with the OpenSSL library. If an attacker manages to exhaust the heap space, this error is not detected and may lead to libssh using a partially initialized cipher context. This occurs because the OpenSSL error code returned aliases with the SSH_OK code, resulting in libssh not properly detecting the error returned by the OpenSSL library. This issue can lead to undefined behavior, including compromised data confidentiality and integrity or crashes.",
  "cwe": "CWE-393",
  "cpes": [
    "cpe:2.3:a:libssh:libssh:*:*:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 8.1,
    "nvd": 8.1
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "",
        "product": "",
        "ranges": [
          "\u003e= 0.10.0, \u003c 0.11.2"
        ],
        "fixed_in": [
          "0.11.2"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat Enterprise Linux 10",
        "ranges": null,
        "fixed_in": [
          "0:0.11.1-5.el10_1"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat Enterprise Linux 10.0 Extended Update Support",
        "ranges": null,
        "fixed_in": [
          "0:0.11.1-4.el10_0.1"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat Enterprise Linux 9",
        "ranges": null,
        "fixed_in": [
          "0:0.10.4-17.el9_7"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat Enterprise Linux 9",
        "ranges": null,
        "fixed_in": [
          "0:0.10.4-17.el9_7"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions",
        "ranges": null,
        "fixed_in": [
          "0:0.10.4-9.el9_2.2"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat Enterprise Linux 9.4 Extended Update Support",
        "ranges": null,
        "fixed_in": [
          "0:0.10.4-13.el9_4.2"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat Enterprise Linux 9.6 Extended Update Support",
        "ranges": null,
        "fixed_in": [
          "0:0.10.4-15.el9_6.1"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat OpenShift Container Platform 4.13",
        "ranges": null,
        "fixed_in": [
          "413.92.202602240113-0"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat OpenShift Container Platform 4.14",
        "ranges": null,
        "fixed_in": [
          "414.92.202601191325-0"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat OpenShift Container Platform 4.15",
        "ranges": null,
        "fixed_in": [
          "415.92.202601271320-0"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat OpenShift Container Platform 4.16",
        "ranges": null,
        "fixed_in": [
          "416.94.202601160124-0"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat OpenShift Container Platform 4.17",
        "ranges": null,
        "fixed_in": [
          "417.94.202601120213-0"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat OpenShift Container Platform 4.18",
        "ranges": null,
        "fixed_in": [
          "418.94.202601202224-0"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat OpenShift Container Platform 4.19",
        "ranges": null,
        "fixed_in": [
          "4.19.9.6.202601260820-0"
        ]
      },
      {
        "vendor": "Red Hat",
        "product": "Red Hat OpenShift Container Platform 4.20",
        "ranges": null,
        "fixed_in": [
          "4.20.9.6.202601211057-0"
        ]
      }
    ],
    "upgrade": [
      "Upgrade the affected product to 0.11.2 or later.",
      "Upgrade Red Hat Enterprise Linux 10 to 0:0.11.1-5.el10_1 or later.",
      "Upgrade Red Hat Enterprise Linux 10.0 Extended Update Support to 0:0.11.1-4.el10_0.1 or later.",
      "Upgrade Red Hat Enterprise Linux 9 to 0:0.10.4-17.el9_7 or later.",
      "Upgrade Red Hat Enterprise Linux 9 to 0:0.10.4-17.el9_7 or later.",
      "Upgrade Red Hat Enterprise Linux 9.2 Update Services for SAP Solutions to 0:0.10.4-9.el9_2.2 or later.",
      "Upgrade Red Hat Enterprise Linux 9.4 Extended Update Support to 0:0.10.4-13.el9_4.2 or later.",
      "Upgrade Red Hat Enterprise Linux 9.6 Extended Update Support to 0:0.10.4-15.el9_6.1 or later.",
      "Upgrade Red Hat OpenShift Container Platform 4.13 to 413.92.202602240113-0 or later.",
      "Upgrade Red Hat OpenShift Container Platform 4.14 to 414.92.202601191325-0 or later.",
      "Upgrade Red Hat OpenShift Container Platform 4.15 to 415.92.202601271320-0 or later.",
      "Upgrade Red Hat OpenShift Container Platform 4.16 to 416.94.202601160124-0 or later.",
      "Upgrade Red Hat OpenShift Container Platform 4.17 to 417.94.202601120213-0 or later.",
      "Upgrade Red Hat OpenShift Container Platform 4.18 to 418.94.202601202224-0 or later.",
      "Upgrade Red Hat OpenShift Container Platform 4.19 to 4.19.9.6.202601260820-0 or later.",
      "Upgrade Red Hat OpenShift Container Platform 4.20 to 4.20.9.6.202601211057-0 or later."
    ],
    "workarounds": [
      "A workaround for this issue is to disable the chacha20-poly1305@openssh.com cipher in applications using libssh when libssh is compiled with the OpenSSL backend, so the vulnerable ChaCha20-Poly1305 initialization path is not used. Alternatively, upgrade to a version of libssh containing the fix; upstream has released libssh 0.11.2 to correct this defect, and administrators are advised to upgrade or apply the upstream patch as soon as possible."
    ],
    "references": [
      {
        "kind": "Vendor advisory",
        "url": "https://access.redhat.com/errata/RHSA-2025:23483"
      },
      {
        "kind": "Vendor advisory",
        "url": "https://access.redhat.com/errata/RHSA-2025:23484"
      },
      {
        "kind": "Vendor advisory",
        "url": "https://access.redhat.com/errata/RHSA-2026:0427"
      },
      {
        "kind": "Vendor advisory",
        "url": "https://access.redhat.com/errata/RHSA-2026:0428"
      },
      {
        "kind": "Vendor advisory",
        "url": "https://access.redhat.com/errata/RHSA-2026:0430"
      },
      {
        "kind": "Vendor advisory",
        "url": "https://access.redhat.com/errata/RHSA-2026:0431"
      },
      {
        "kind": "Vendor advisory",
        "url": "https://access.redhat.com/errata/RHSA-2026:0702"
      },
      {
        "kind": "Vendor advisory",
        "url": "https://access.redhat.com/errata/RHSA-2026:0978"
      }
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
