CVE-2017-9951
High · 7.5CVSS
7.5
EPSS
4.2%
Published
Jul 17, 2017
CISA due date
—
Cloudanix analysis
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.
- 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
- Connect to an exposed memcached TCP port
- Transmit a malicious add or set request that triggers the signed/unsigned comparison
- Induce heap buffer over-read and segmentation fault
- 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
- CVE-2016-8704 An integer overflow in the process_bin_append_prepend function in Memcached, which is… Also affects memcached
- CVE-2016-8706 An integer overflow in process_bin_sasl_auth function in Memcached, which is responsible… Also affects memcached
- CVE-2016-8705 Multiple integer overflows in process_bin_update function in Memcached, which is… Also affects memcached
- CVE-2011-4971 Multiple integer signedness errors in the (1) process_bin_sasl_auth, (2)… Also affects memcached
- CVE-2010-1152 memcached.c in memcached before 1.4.3 allows remote attackers to cause a denial of… Also affects memcached
- CVE-2019-0201 An issue is present in Apache ZooKeeper 1.0.0 to 3.4.13 and 3.5.0-alpha to 3.5.4-beta. Also affects memcached
- CVE-2026-47784 In memcached before 1.6.42, password data for SASL password database authentication has a… Also affects memcached
- CVE-2026-47783 In memcached before 1.6.42, username data for SASL password database authentication has a… Also affects memcached