|
| 1 | +--- |
| 2 | +gem: dalli |
| 3 | +ghsa: 6wmv-xq9m-fmp7 |
| 4 | +url: https://github.com/petergoldstein/dalli/security/advisories/GHSA-6wmv-xq9m-fmp7 |
| 5 | +title: Memcached command injection through numeric arguments to incr/decr |
| 6 | + and fetch_with_lock |
| 7 | +date: 2026-09-24 |
| 8 | +description: | |
| 9 | + Dalli's meta protocol request formatter wrote some numeric arguments |
| 10 | + into memcached commands without converting them to integers. If an |
| 11 | + application passes an attacker-controlled String to one of these |
| 12 | + arguments, CRLF sequences in it are sent to memcached as additional |
| 13 | + commands on the same connection, letting the attacker run arbitrary |
| 14 | + memcached commands, such as overwriting keys or running `flush_all`. |
| 15 | +
|
| 16 | + The affected arguments are the `default` (initial value) argument of |
| 17 | + `Dalli::Client#incr` and `#decr`, and the `lock_ttl` and |
| 18 | + `recache_threshold` arguments of `Dalli::Client#fetch_with_lock` |
| 19 | + (4.2.0 and later). |
| 20 | +
|
| 21 | + In 3.2.x and 4.x, only clients created with `protocol: :meta` are |
| 22 | + affected; the default binary protocol is not. All 5.x configurations |
| 23 | + are affected. |
| 24 | +
|
| 25 | + An application is only exploitable if untrusted input reaches one of |
| 26 | + these arguments. |
| 27 | +
|
| 28 | + ### Workarounds |
| 29 | +
|
| 30 | + Convert values to integers before passing them, e.g. |
| 31 | + `Integer(params[:initial], 10)`. On 3.2.x and 4.x, use the default |
| 32 | + binary protocol instead of `protocol: :meta`. |
| 33 | +cvss_v3: 7.7 |
| 34 | +unaffected_versions: |
| 35 | + - "< 3.2.0" |
| 36 | +patched_versions: |
| 37 | + - "~> 3.2.9" |
| 38 | + - "~> 4.3.4" |
| 39 | + - "~> 5.0.7" |
| 40 | + - ">= 5.1.1" |
| 41 | +related: |
| 42 | + url: |
| 43 | + - https://github.com/petergoldstein/dalli/security/advisories/GHSA-6wmv-xq9m-fmp7 |
| 44 | + - https://github.com/petergoldstein/dalli/commit/7bd7daf |
| 45 | + - https://rubygems.org/gems/dalli/versions/5.1.1 |
| 46 | + - https://github.com/petergoldstein/dalli/releases/tag/v5.1.1 |
| 47 | + - https://rubygems.org/gems/dalli/versions/5.0.7 |
| 48 | + - https://github.com/petergoldstein/dalli/releases/tag/v5.0.7 |
| 49 | + - https://rubygems.org/gems/dalli/versions/4.3.4 |
| 50 | + - https://github.com/petergoldstein/dalli/releases/tag/v4.3.4 |
| 51 | + - https://rubygems.org/gems/dalli/versions/3.2.9 |
| 52 | + - https://github.com/petergoldstein/dalli/releases/tag/v3.2.9 |
| 53 | +notes: | |
| 54 | + - No CVE in GHSA. |
| 55 | + - "A CVE has been requested through GitHub but not yet |
| 56 | + assigned, so the entry has no cve: field." |
| 57 | + - cvss_v3 from GHSA URL. |
0 commit comments