CVE-2020-1899:Memory access vulnerability in HHVM's unserialize() function allowing arbitrary memory access through the "S" type code.

splash
Back

Description Preview

A vulnerability in HHVM's unserialize() function was discovered where the function incorrectly supported a type code "S" that was intended only for APC serialization. This implementation flaw allowed attackers to access arbitrary memory addresses as if they were static StringData objects, potentially leading to information disclosure or remote code execution. The vulnerability affected multiple versions of HHVM including versions prior to v4.32.3 and between versions 4.33.0 and 4.62.0 with some specific versions in between.

Overview

CVE-2020-1899 is a memory corruption vulnerability (CWE-119) in HHVM (HipHop Virtual Machine), Facebook's open-source virtual machine for executing programs written in Hack and PHP. The vulnerability exists in the unserialize() function which incorrectly processes the "S" type code that was intended only for internal APC serialization. When exploited, this vulnerability allows an attacker to treat arbitrary memory addresses as static StringData objects, potentially leading to information disclosure, memory corruption, or remote code execution. This vulnerability is particularly dangerous in applications that unserialize user-controlled data without proper validation.

Remediation

To remediate this vulnerability, users should update to HHVM version 4.62.1 or later which contains the fix for this issue. If immediate updating is not possible, consider implementing the following mitigations:

  1. Avoid unserializing user-controlled data whenever possible.
  2. If unserializing user data is necessary, implement strict input validation before passing data to unserialize().
  3. Consider using safer alternatives for data interchange such as JSON.
  4. Apply network-level controls to restrict access to HHVM-powered applications to trusted sources only.

For developers maintaining custom HHVM builds, the patch can be found in the GitHub commit referenced below.

References

  1. HHVM Security Update Blog Post: https://hhvm.com/blog/2020/06/30/security-update.html
  2. Fix Commit: https://github.com/facebook/hhvm/commit/1107228a5128d3ca1c4add8ac1635d933cbbe2e9
  3. CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer - https://cwe.mitre.org/data/definitions/119.html

Industry ExposureMost to least
This section illustrates the prevalence of a specific Common Vulnerabilities and Exposures (CVE) across various industries based on customer reports. The ranking displays industries from the most to least affected by this particular vulnerability, offering valuable insight into where this CVE has been most frequently observed. This information can help organizations within these sectors prioritize their security efforts, understand their relative risk exposure compared to their peers, and focus remediation strategies where they are most needed. By understanding the industry-specific impact, organizations can make more informed decisions regarding patching, resource allocation, and overall risk management related to this CVE.

  1. Accommodation & Food Services
    Accommodation & Food Services
  2. Administrative, Support, Waste Management & Remediation Services
    Administrative, Support, Waste Management & Remediation Services
  3. Agriculture, Forestry Fishing & Hunting
    Agriculture, Forestry Fishing & Hunting
  4. Arts, Entertainment & Recreation
    Arts, Entertainment & Recreation
  5. Construction
    Construction
  6. Educational Services
    Educational Services
  7. Finance and Insurance
    Finance and Insurance
  8. Health Care & Social Assistance
    Health Care & Social Assistance
  9. Information
    Information
  10. Management of Companies & Enterprises
    Management of Companies & Enterprises
  11. Manufacturing
    Manufacturing
  12. Mining
    Mining
  13. Other Services (except Public Administration)
    Other Services (except Public Administration)
  14. Professional, Scientific, & Technical Services
    Professional, Scientific, & Technical Services
  15. Public Administration
    Public Administration
  16. Real Estate Rental & Leasing
    Real Estate Rental & Leasing
  17. Retail Trade
    Retail Trade
  18. Transportation & Warehousing
    Transportation & Warehousing
  19. Utilities
    Utilities
  20. Wholesale Trade
    Wholesale Trade

Focus on What Matters

  1. See Everything.
  2. Identify True Risk.
  3. Proactively Mitigate Threats.

Let's talk!

background
Armis Vulnerability Intelligence Database