CVE-2018-3767

9.1 CRITICAL

📋 TL;DR

CVE-2018-3767 is a vulnerability in memjs library where improper buffer allocation for typed input can lead to denial of service and exposure of uninitialized memory. This affects any application using memjs version 1.1.0 or earlier for Memcached client functionality. Attackers can potentially crash services or access sensitive memory contents.

💻 Affected Systems

Products:
  • memjs
Versions: <= 1.1.0
Operating Systems: All
Default Config Vulnerable: ⚠️ Yes
Notes: Any Node.js application using vulnerable memjs versions for Memcached communication is affected regardless of configuration.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete service disruption through DoS combined with exposure of sensitive memory contents including credentials, session data, or application secrets.

🟠

Likely Case

Service instability or crashes leading to availability issues, with potential memory leakage exposing limited application data.

🟢

If Mitigated

Minimal impact with proper input validation and memory isolation, though some performance degradation may occur.

🌐 Internet-Facing: HIGH - Memcached clients often handle user input and are exposed to network traffic.
🏢 Internal Only: MEDIUM - Internal services using memjs could still be exploited by authenticated users or through other attack vectors.

🎯 Exploit Status

Public PoC: ⚠️ Yes
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

Exploitation requires sending specially crafted typed input to memjs, which is straightforward for attackers with network access to vulnerable services.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 1.1.1

Vendor Advisory: https://github.com/memcachier/memjs/security/advisories/GHSA-4x2f-54x6-4vg8

Restart Required: Yes

Instructions:

1. Update memjs dependency to version 1.1.1 or later. 2. Run 'npm update memjs' or update package.json. 3. Restart all affected Node.js applications. 4. Verify the update with 'npm list memjs'.

🔧 Temporary Workarounds

Input Validation Wrapper

all

Implement input validation to reject typed arrays or objects before passing to memjs functions.

// JavaScript wrapper example: function safeMemjsCall(value) { if (typeof value !== 'string') throw new Error('Invalid input type'); return memjsCall(value); }

🧯 If You Can't Patch

  • Implement network segmentation to restrict access to Memcached services only from trusted sources.
  • Deploy Web Application Firewall (WAF) rules to detect and block suspicious Memcached protocol patterns.

🔍 How to Verify

Check if Vulnerable:

Check package.json or run 'npm list memjs' to see if version <=1.1.0 is installed.

Check Version:

npm list memjs | grep memjs

Verify Fix Applied:

Confirm memjs version is 1.1.1 or later with 'npm list memjs' and test application functionality with Memcached operations.

📡 Detection & Monitoring

Log Indicators:

  • Application crashes or restarts related to memjs, memory allocation errors in Node.js logs, unexpected process termination.

Network Indicators:

  • Unusual Memcached protocol traffic patterns, repeated connection attempts to Memcached ports (typically 11211).

SIEM Query:

source="application.logs" AND ("memjs" OR "Memory allocation failed" OR "process crashed")

🔗 References

📤 Share & Export