Skip to main content

CVE-2018-6340: Out-of-bounds Read (CWE-125) in Facebook HHVM

High
VulnerabilityCVE-2018-6340cvecve-2018-6340cwe-125
Published: Mon Dec 31 2018 (12/31/2018, 22:00:00 UTC)
Source: CVE
Vendor/Project: Facebook
Product: HHVM

Description

The Memcache::getextendedstats function can be used to trigger an out-of-bounds read. Exploiting this issue requires control over memcached server hostnames and/or ports. This affects all supported versions of HHVM (3.30 and 3.27.4 and below).

AI-Powered Analysis

AILast updated: 07/03/2025, 07:56:21 UTC

Technical Analysis

CVE-2018-6340 is a high-severity vulnerability identified in Facebook's HHVM (HipHop Virtual Machine), specifically affecting versions 3.27.4 and below, including 3.27.5, 3.30.0, and 3.30.1. The vulnerability arises from an out-of-bounds read condition (CWE-125) in the Memcache::getextendedstats function. This function interacts with memcached servers to retrieve extended statistics. The flaw can be exploited if an attacker gains control over the memcached server hostnames and/or ports that HHVM connects to. By manipulating these parameters, an attacker can trigger an out-of-bounds read, potentially leading to the disclosure of sensitive memory contents, which compromises confidentiality. Furthermore, the CVSS vector indicates that the vulnerability impacts confidentiality, integrity, and availability (all rated high), suggesting that exploitation could also allow data tampering or denial of service. The attack vector is network-based (AV:N), but requires high attack complexity (AC:H), no privileges (PR:N), and no user interaction (UI:N). The scope is unchanged (S:U), meaning the impact is limited to the vulnerable component. No known exploits in the wild have been reported, and no official patches are linked in the provided data, indicating that remediation may require manual updates or configuration changes. HHVM is a virtual machine designed to execute PHP and Hack code efficiently, and is used by some organizations for web application hosting and development. The vulnerability's exploitation depends on the ability to influence memcached server configurations, which may limit exposure to internal or misconfigured environments.

Potential Impact

For European organizations utilizing HHVM versions affected by CVE-2018-6340, the potential impact includes unauthorized disclosure of sensitive data due to out-of-bounds memory reads. This can lead to leakage of credentials, session tokens, or other confidential information stored in memory. Additionally, the vulnerability could be leveraged to disrupt service availability or corrupt data integrity, affecting business continuity and trust. Organizations relying on memcached for caching in conjunction with HHVM are particularly at risk if memcached server hostnames or ports can be manipulated by attackers, such as through DNS poisoning, network misconfigurations, or insider threats. Given the high CVSS score (8.1), the vulnerability represents a significant risk, especially in environments where HHVM is exposed to untrusted networks or where memcached configurations are not tightly controlled. The absence of known exploits in the wild reduces immediate risk but does not eliminate the threat, as attackers could develop exploits. European organizations in sectors with stringent data protection requirements (e.g., finance, healthcare, government) face heightened regulatory and reputational risks if this vulnerability is exploited.

Mitigation Recommendations

To mitigate CVE-2018-6340, European organizations should: 1) Upgrade HHVM to versions beyond 3.30.1 where the vulnerability is addressed, or apply any available security patches from Facebook or the HHVM community. 2) Restrict and tightly control memcached server hostnames and ports to prevent unauthorized manipulation; this includes using network segmentation, firewall rules, and access controls to limit memcached exposure. 3) Employ DNS security measures such as DNSSEC to prevent DNS spoofing or poisoning that could redirect memcached connections. 4) Monitor network traffic and logs for unusual memcached queries or connections that could indicate exploitation attempts. 5) Conduct regular security assessments and code audits of applications using HHVM and memcached to identify and remediate configuration weaknesses. 6) If upgrading is not immediately feasible, consider disabling or restricting the use of the Memcache::getextendedstats function or memcached integration within HHVM as a temporary workaround. 7) Educate development and operations teams about the risks associated with memcached exposure and the importance of secure configuration management.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
facebook
Date Reserved
2018-01-26T00:00:00.000Z
Cisa Enriched
true
Cvss Version
3.1
State
PUBLISHED

Threat ID: 682d981bc4522896dcbda085

Added to database: 5/21/2025, 9:08:43 AM

Last enriched: 7/3/2025, 7:56:21 AM

Last updated: 7/26/2025, 12:11:57 PM

Views: 10

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats