CVE-2025-5318: libssh: OOB read in SFTP handle leaks memory
HIGH PoC AVAILABLEThis is a memory-safety bug in libssh's sftp_handle function: an incorrect comparison check lets an authenticated attacker reference a handle outside the valid list, returning an invalid pointer that gets used in further processing and can expose unintended memory or degrade service. It carries a CVSS of 8.1 (high) and sits in the top 18% of EPSS-scored vulnerabilities for exploitation likelihood, with public PoC code already circulating, though it is not in CISA KEV and CISA's own SSVC call is TRACK rather than an urgent action signal. The AI-relevant angle isn't vLLM's own logic — it's that Red Hat's AI Inference Server images (rhaiis/vllm-cuda-rhel9, rhaiis/vllm-rocm-rhel9) bundle libssh as a base-image dependency, and libssh itself has 129 downstream dependents and 82 other historical CVEs, so this is a supply-chain exposure riding along with the inference stack rather than a novel model-layer attack. Patch to libssh 0.11.2+ or pull the matching Red Hat errata for your RHAIIS image tags, and since exploitation requires an authenticated low-privilege session, restrict and monitor who can reach SSH/SFTP on hosts running these images.
What is the risk?
Moderate-to-high risk in principle (CVSS 8.1, high confidentiality and availability impact) but tempered by the PR:L requirement — an attacker needs a valid low-privilege authenticated session before triggering the flaw, which meaningfully narrows the practical attack surface versus an unauthenticated remote bug. EPSS at the 18th percentile and SSVC=TRACK indicate no evidence of active mass exploitation, but the public PoC raises the probability of opportunistic weaponization once attackers have any foothold (e.g. stolen credentials, compromised service account). Because libssh underlies many services beyond AI workloads (129 dependents, 82 prior CVEs), risk should be tracked at the library/base-image level, not treated as an AI-specific threat.
How does the attack unfold?
What systems are affected?
| Package | Ecosystem | Vulnerable Range | Patched |
|---|---|---|---|
| vLLM | pip | — | No patch |
| vLLM | pip | — | No patch |
| libssh | — | — | No patch |
| rhaiis/model-opt-cuda-rhel9 | — | — | No patch |
| rhcos | — | — | No patch |
| rhosdt/tempo-gateway-opa-rhel8 | — | — | No patch |
| rhosdt/tempo-gateway-rhel8 | — | — | No patch |
| rhosdt/tempo-jaeger-query-rhel8 | — | — | No patch |
| rhosdt/tempo-query-rhel8 | — | — | No patch |
| rhosdt/tempo-rhel8 | — | — | No patch |
| rhosdt/tempo-rhel8-operator | — | — | No patch |
How severe is it?
What is the attack surface?
What should I do?
1 step-
Upgrade libssh to 0.11.2 or later on any host or container image where it is present. For Red Hat AI Inference Server deployments, pull updated rhaiis/vllm-cuda-rhel9 and rhaiis/vllm-rocm-rhel9 image tags per the listed RHSA errata (RHSA-2025:18231, 18275, 18286, 19012, 19098, 19101, 19295, 19300, 19313, 19400) and redeploy. As a compensating control, restrict SSH/SFTP access on inference hosts to trusted management networks and enforce least-privilege on any accounts with SFTP access, since exploitation requires an authenticated low-privilege session. Detection: monitor for anomalous or malformed SFTP handle requests, unexpected sshd/libssh process crashes, or out-of-pattern memory-read errors in logs on hosts serving RHAIIS images.
What does CISA's SSVC say?
Source: CISA Vulnrichment (SSVC v2.0). Decision based on the CISA Coordinator decision tree.
How is it classified?
Which compliance frameworks are affected?
This CVE is relevant to:
Frequently Asked Questions
What is CVE-2025-5318?
This is a memory-safety bug in libssh's sftp_handle function: an incorrect comparison check lets an authenticated attacker reference a handle outside the valid list, returning an invalid pointer that gets used in further processing and can expose unintended memory or degrade service. It carries a CVSS of 8.1 (high) and sits in the top 18% of EPSS-scored vulnerabilities for exploitation likelihood, with public PoC code already circulating, though it is not in CISA KEV and CISA's own SSVC call is TRACK rather than an urgent action signal. The AI-relevant angle isn't vLLM's own logic — it's that Red Hat's AI Inference Server images (rhaiis/vllm-cuda-rhel9, rhaiis/vllm-rocm-rhel9) bundle libssh as a base-image dependency, and libssh itself has 129 downstream dependents and 82 other historical CVEs, so this is a supply-chain exposure riding along with the inference stack rather than a novel model-layer attack. Patch to libssh 0.11.2+ or pull the matching Red Hat errata for your RHAIIS image tags, and since exploitation requires an authenticated low-privilege session, restrict and monitor who can reach SSH/SFTP on hosts running these images.
Is CVE-2025-5318 actively exploited?
Proof-of-concept exploit code is publicly available for CVE-2025-5318, increasing the risk of exploitation.
How to fix CVE-2025-5318?
Upgrade libssh to 0.11.2 or later on any host or container image where it is present. For Red Hat AI Inference Server deployments, pull updated rhaiis/vllm-cuda-rhel9 and rhaiis/vllm-rocm-rhel9 image tags per the listed RHSA errata (RHSA-2025:18231, 18275, 18286, 19012, 19098, 19101, 19295, 19300, 19313, 19400) and redeploy. As a compensating control, restrict SSH/SFTP access on inference hosts to trusted management networks and enforce least-privilege on any accounts with SFTP access, since exploitation requires an authenticated low-privilege session. Detection: monitor for anomalous or malformed SFTP handle requests, unexpected sshd/libssh process crashes, or out-of-pattern memory-read errors in logs on hosts serving RHAIIS images.
What systems are affected by CVE-2025-5318?
This vulnerability affects the following AI/ML architecture patterns: model serving, AI inference container images.
What is the CVSS score for CVE-2025-5318?
CVE-2025-5318 has a CVSS v3.1 base score of 8.1 (HIGH). The EPSS exploitation probability is 1.49%.
What is the AI security impact?
Affected AI Architectures
MITRE ATLAS Techniques
AML.T0010.001 AI Software Compliance Controls Affected
What are the technical details?
Original Advisory
A flaw was found in the libssh library in versions less than 0.11.2. An out-of-bounds read can be triggered in the sftp_handle function due to an incorrect comparison check that permits the function to access memory beyond the valid handle list and to return an invalid pointer, which is used in further processing. This vulnerability allows an authenticated remote attacker to potentially read unintended memory regions, exposing sensitive information or affect service behavior.
Exploitation Scenario
An attacker who has obtained low-privilege, authenticated SSH/SFTP credentials to a host running an RHAIIS vLLM inference image (e.g. via a phished service account, leaked API key reused for SSH, or an over-permissioned CI/CD deploy account) issues a crafted sequence of SFTP handle requests designed to trigger the faulty comparison check in sftp_handle. The out-of-bounds read returns a pointer outside the valid handle list, and the server uses it in subsequent processing, either leaking adjacent memory contents back to the attacker (potentially containing session tokens, buffered credentials, or configuration data) or crashing the sshd/libssh process and disrupting management access to the inference server. The attack does not touch the model or inference API directly but could be a stepping stone to broader host compromise or a denial-of-service against operational access to the AI serving infrastructure.
Weaknesses (CWE)
CWE-125 — Out-of-bounds Read: The product reads data past the end, or before the beginning, of the intended buffer.
- [Implementation] Assume all input is malicious. Use an "accept known good" input validation strategy, i.e., use a list of acceptable inputs that strictly conform to specifications. Reject any input that does not strictly conform to specifications, or transform it into something that does. When performing input validation, consider all potentially relevant properties, including length, type of input, the full range of acceptable values, missing or extra inputs, syntax, consistency across related fields, and conformance to business rules. As an example of business rule logic, "boat" may be syntactically valid because it only contains alphanumeric characters, but it is not valid if the input is only expected to contain colors such as "red" or "blue." Do not rely exclusively on looking for malicious or malformed inputs. This is likely to miss at least one undesirable input, especially if the code's environment changes. This can give attackers enough room to bypass the intended validation. However, denylis
- [Architecture and Design] Use a language that provides appropriate memory abstractions.
Source: MITRE CWE corpus.
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H References
- access.redhat.com/errata/RHSA-2025:18231 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:18275 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:18286 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19012 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19098 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19101 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19295 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19300 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19313 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19400 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19401 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19470 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19472 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19807 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:19864 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:20943 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:21013 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:21329 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:21829 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:22275 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:23078 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:23079 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2025:23080 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2026:0326 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2026:1541 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2026:3461 vendor-advisory x_refsource_REDHAT
- access.redhat.com/errata/RHSA-2026:3462 vendor-advisory x_refsource_REDHAT
- access.redhat.com/security/cve/CVE-2025-5318 vdb-entry x_refsource_REDHAT
- bugzilla.redhat.com/show_bug.cgi issue-tracking x_refsource_REDHAT
- libssh.org/security/advisories/CVE-2025-5318.txt
- github.com/8-cm/kube-dump Exploit
Timeline
Related Vulnerabilities
CVE-2024-9053 9.8 vllm: RCE via unsafe pickle deserialization in RPC server
Same package: vllm CVE-2024-11041 9.8 vllm: RCE via unsafe pickle deserialization in MessageQueue
Same package: vllm CVE-2025-47277 9.8 vLLM: RCE via exposed TCPStore in distributed inference
Same package: vllm CVE-2026-25960 9.8 vllm: SSRF allows internal network access
Same package: vllm CVE-2025-32444 9.8 vLLM: RCE via pickle deserialization on ZeroMQ
Same package: vllm