CVE-2022-4064: Dalli Unsanitized Input Leading To Code Vulnerability

LOW
Advisory Identifier: GHSA-3xg8-cc8f-9wv2
CVSS 3.7
CWE-74
Published
Advisory Summary

CVE-2022-4064 is a LOW (CVSS 3.7) unsanitized input leading to code vulnerability (CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')) affecting Dalli libraries in the RubyGems ecosystem. The issue involves unsanitized input leading to code injection in dalli. Remediation is available by upgrading affected packages to version 3.2.3.

CVE-2022-4064 at a Glance

CVE Identifier CVE-2022-4064
GHSA Identifier GHSA-3xg8-cc8f-9wv2
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection')
Affected Product Dalli
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 3.7

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2022-4064

To remediate this vulnerability, upgrade all affected Dalli dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

dalli fixed: 3.2.3
Upgrade dalli to 3.2.3
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for dalli

How to Check if You Are Affected

To determine whether your application is affected by CVE-2022-4064, inspect your project dependencies for Dalli:

inspect dependencies for dalli

Analyze the terminal output to locate any version of Dalli in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 3.2.3), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection'), where the product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component. In Dalli, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

A vulnerability was found in Dalli. Affected is the function self.meta_set of the file lib/dalli/protocol/meta/request_formatter.rb of the component Meta Protocol Handler. The manipulation leads to injection. The exploit has been disclosed to the public and may be used. The name of the patch is 48d594dae55934476fec61789e7a7c3700e0f50d. It is recommended to apply a patch to fix this issue.

CVE-2022-4064 Affected Dalli Versions

1 component(s)
Fixed Versions:
3.2.3
Product / Package Ecosystem Affected Versions Fixed Version
dalli
RubyGems
< 3.2.3
3.2.3

References

Frequently Asked Questions

What is CVE-2022-4064?
CVE-2022-4064 is a security vulnerability in Dalli involving Unsanitized input leading to code injection in Dalli under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection').
Which Dalli versions are affected?
Affected versions include releases prior to 3.2.3 across affected packages: dalli.
What version fixes CVE-2022-4064?
Upgrading to 3.2.3 (or the latest patched release for your respective branch) resolves the vulnerability.
Is dalli affected?
Yes, dalli is affected in releases prior to 3.2.3. Upgrade your dependency to 3.2.3 or later.
What is the CVSS score of CVE-2022-4064?
CVE-2022-4064 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2022-4064?
CVE-2022-4064 is classified under CWE-74: Improper Neutralization of Special Elements in Output Used by a Downstream Component ('Injection') (The product constructs all or part of a command, data structure, or record using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify how it is parsed or interpreted when it is sent to a downstream component.).
How can I check RubyGems dependencies for CVE-2022-4064?
Run the dependency tree command: 'inspect dependencies for dalli'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-3xg8-cc8f-9wv2",
  "modified" : "2022-11-26T20:22:00Z",
  "published" : "2022-11-19T21:30:26Z",
  "aliases" : [ "CVE-2022-4064" ],
  "summary" : "Unsanitized input leading to code injection in Dalli",
  "details" : "A vulnerability was found in Dalli. Affected is the function self.meta_set of the file lib/dalli/protocol/meta/request_formatter.rb of the component Meta Protocol Handler. The manipulation leads to injection. The exploit has been disclosed to the public and may be used. The name of the patch is 48d594dae55934476fec61789e7a7c3700e0f50d. It is recommended to apply a patch to fix this issue. ",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "dalli"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.2.3"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-4064"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/petergoldstein/dalli/issues/932"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/petergoldstein/dalli/pull/933"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/petergoldstein/dalli/commit/48d594dae55934476fec61789e7a7c3700e0f50d"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/petergoldstein/dalli"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/dalli/CVE-2022-4064.yml"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.214026"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-74" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-11-21T23:54:20Z",
    "nvd_published_at" : "2022-11-19T19:15:00Z"
  }
}