Cloudanix VulnDB

CVE-2017-9951

High · 7.5

CVSS

7.5

EPSS

4.2%

Published

Jul 17, 2017

CISA due date

—

Cloudanix analysis

Next patch cycle SSVC: Track

Attackers can crash the memcached service by sending certain requests, which can slow down or disrupt applications that depend on it for fast data access.

Exploit Available
Exploitation
Remote Unauthenticated
Attacker needs
None
Complexity
Low
Impact
Denial Of Service
Component
Network Service
Class
Buffer Overflow
Remediation
Upgrade
Effort
Medium
Patch risk
Low

What it actually does

Remote unauthenticated attacker triggers a heap-based buffer over-read in try_read_command via a crafted add/set request due to signed-versus-unsigned integer comparison, resulting in a segmentation fault.

Why it matters to the business

Service crashes cause loss of the caching layer, leading to increased database load, slower application responses, and potential downtime for any systems relying on memcached.

How an attack unfolds

An attacker sends a specially crafted memcached protocol request containing an add or set command that exploits the incomplete fix for the prior signed/unsigned comparison flaw; the resulting over-read produces a crash. Public exploits have been available for years, though the vulnerability has not appeared in CISA KEV or ransomware campaigns.

How to fix it

Upgrade memcached to 1.4.39 or later. For dex (Chainguard) and dex (Wolfi) deployments, ensure the supplied fixed versions (0) or equivalent patched packages are in use; restrict network access to trusted clients only.

How to confirm the fix worked

Confirm memcached version is at least 1.4.39; run regression tests with known triggering add/set payloads; monitor process stability under load.

Typical attack path

  1. Connect to an exposed memcached TCP port
  2. Transmit a malicious add or set request that triggers the signed/unsigned comparison
  3. Induce heap buffer over-read and segmentation fault
  4. Observe service crash and restart loop

How to detect it

Inspect memcached logs and system crash reports for segmentation faults occurring after add/set operations; correlate with unusual request patterns from untrusted sources.

  • segmentation fault.*memcached
  • try_read_command
  • memcached.*heap buffer over-read

What your security team should do

  • Immediately upgrade all memcached instances to 1.4.39+
  • Apply network segmentation or firewall rules to limit memcached exposure
  • Enable process monitoring and automatic restart with crash logging
  • Review downstream dependents for any custom builds still using vulnerable code

The record

The try_read_command function in memcached.c in memcached before 1.4.39 allows remote attackers to cause a denial of service (segmentation fault) via a request to add/set a key, which makes a comparison between signed and unsigned int and triggers a heap-based buffer over-read. NOTE: this vulnerability exists because of an incomplete fix for CVE-2016-8705.

Affected packages

Ecosystem Package Introduced Fixed
Alpine:v3.3 memcached 0 1.4.33-r1
Alpine:v3.4 memcached 0 1.4.33-r1
Alpine:v3.5 memcached 0 1.4.33-r1
Alpine:v3.6 memcached 0 1.4.36-r1
Debian:11 memcached 0 1.5.0-1
Debian:12 memcached 0 1.5.0-1
Debian:13 memcached 0 1.5.0-1
Debian:14 memcached 0 1.5.0-1
Debian:7 memcached 0 1.4.13-0.2+deb7u3
Debian:8 memcached 0 1.4.21-1.1+deb8u2
Debian:9 memcached 0 1.4.33-1+deb9u1
Mageia:5 memcached 0 1.4.39-1.mga5
Mageia:6 memcached 0 1.4.39-1.mga6
SUSE:Enterprise Storage 4 memcached 0 1.4.39-3.3.2
SUSE:Linux Enterprise Server 12 SP2 memcached 0 1.4.39-4.3.1
SUSE:Linux Enterprise Server 12 SP3 memcached 0 1.4.39-4.3.1
SUSE:Linux Enterprise Server for Raspberry Pi 12 SP2 memcached 0 1.4.39-4.3.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP2 memcached 0 1.4.39-4.3.1
SUSE:Linux Enterprise Server for SAP Applications 12 SP3 memcached 0 1.4.39-4.3.1
SUSE:Linux Enterprise Software Development Kit 11 SP4 memcached 0 1.2.6-5.17.4.1
SUSE:Linux Enterprise Software Development Kit 12 SP2 memcached 0 1.4.39-4.3.1
SUSE:OpenStack Cloud 6 memcached 0 1.4.39-3.3.1
SUSE:OpenStack Cloud 7 memcached 0 1.4.39-3.3.2
SUSE:Studio Onsite 1.3 memcached 0 1.2.6-5.17.4.1
SUSE:Studio Onsite Runner 1.3 memcached 0 1.2.6-5.17.4.1
Ubuntu:14.04:LTS memcached 0 1.4.14-0ubuntu9.2
Ubuntu:16.04:LTS memcached 0 1.4.25-2ubuntu1.3
openSUSE:Tumbleweed memcached 0 1.6.9-2.3

Related vulnerabilities