CVE-2023-27531: Kredis Kredis JSON Possible Deserialization Of Vulnerability

MODERATE
Advisory Identifier: GHSA-h2wm-p2vg-6pw4
CVSS 5.3
CWE-502
Published
Advisory Summary

CVE-2023-27531 is a MODERATE (CVSS 5.3) kredis json possible deserialization of vulnerability (CWE-502: Deserialization of Untrusted Data) affecting Kredis libraries in the RubyGems ecosystem. The issue involves kredis json possible deserialization of untrusted data vulnerability. Remediation is available by upgrading affected packages to version 1.3.0.1.

CVE-2023-27531 at a Glance

CVE Identifier CVE-2023-27531
GHSA Identifier GHSA-h2wm-p2vg-6pw4
Severity MODERATE
CVSS v3.1 Base Score 5.3
CWE Classification CWE-502: Deserialization of Untrusted Data
Affected Product Kredis
Package Ecosystem RubyGems
Published Date
Last Updated

Security Impact

CVSS: 5.3

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

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

How to Fix CVE-2023-27531

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

kredis fixed: 1.3.0.1
Upgrade kredis to 1.3.0.1
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 kredis

How to Check if You Are Affected

To determine whether your application is affected by CVE-2023-27531, inspect your project dependencies for Kredis:

inspect dependencies for kredis

Analyze the terminal output to locate any version of Kredis in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.3.0.1), 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-502: Deserialization of Untrusted Data, where the product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid. In Kredis, 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

There is a deserialization of untrusted data vulnerability in the Kredis JSON deserialization code. This vulnerability has been assigned the CVE identifier CVE-2023-27531. 'Not affected: None.' 'Versions Affected: All.' 'Fixed Versions: 1.3.0.1' Impact Carefully crafted JSON data processed by Kredis may result in deserialization of untrusted data, potentially leading to deserialization of unexpected objects in the system. Any applications using Kredis with JSON are affected. Releases The fixed releases are available at the normal locations. Workarounds There are no feasible workarounds for this issue. Patches To aid users who aren’t able to upgrade immediately we have provided patches for the two supported release series. They are in git-am format and consist of a single changeset. * 1-3-0-1-kredis.patch - Patch for 1.3.0 series Credits Thank you ooooooo_k 7 for reporting this!

CVE-2023-27531 Affected Kredis Versions

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

References

Frequently Asked Questions

What is CVE-2023-27531?
CVE-2023-27531 is a security vulnerability in Kredis involving Kredis JSON Possible Deserialization of Untrusted Data Vulnerability under CWE-502: Deserialization of Untrusted Data.
Which Kredis versions are affected?
Affected versions include releases prior to 1.3.0.1 across affected packages: kredis.
What version fixes CVE-2023-27531?
Upgrading to 1.3.0.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is kredis affected?
Yes, kredis is affected in releases prior to 1.3.0.1. Upgrade your dependency to 1.3.0.1 or later.
What is the CVSS score of CVE-2023-27531?
CVE-2023-27531 has a CVSS v3.1 base score of 5.3 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N.
What CWE is associated with CVE-2023-27531?
CVE-2023-27531 is classified under CWE-502: Deserialization of Untrusted Data (The product deserializes untrusted data without sufficiently ensuring that the resulting data will be valid.).
How can I check RubyGems dependencies for CVE-2023-27531?
Run the dependency tree command: 'inspect dependencies for kredis'. 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-h2wm-p2vg-6pw4",
  "modified" : "2025-01-10T18:32:54Z",
  "published" : "2023-06-09T22:40:54Z",
  "aliases" : [ "CVE-2023-27531" ],
  "summary" : "Kredis JSON Possible Deserialization of Untrusted Data Vulnerability",
  "details" : "There is a deserialization of untrusted data vulnerability in\nthe Kredis JSON deserialization code. This vulnerability has\nbeen assigned the CVE identifier CVE-2023-27531.\n\n'Not affected: None.'\n'Versions Affected: All.'\n'Fixed Versions: 1.3.0.1'\n\nImpact\n  Carefully crafted JSON data processed by Kredis may result in\n  deserialization of untrusted data, potentially leading to\n  deserialization of unexpected objects in the system.\n\n  Any applications using Kredis with JSON are affected.\n\nReleases\n  The fixed releases are available at the normal locations.\n\nWorkarounds\n  There are no feasible workarounds for this issue.\n\nPatches\n  To aid users who aren’t able to upgrade immediately we have\n  provided patches for the two supported release series. They\n  are in git-am format and consist of a single changeset.\n\n  * 1-3-0-1-kredis.patch - Patch for 1.3.0 series\n\nCredits\n  Thank you ooooooo_k 7 for reporting this!\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "RubyGems",
      "name" : "kredis"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.3.0.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2023-27531"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/kredis/commit/d576b7ae5c8d3d74eeb4bd84cad0aa64ffc299fa"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.rubyonrails.org/t/cve-2023-27531-possible-deserialization-of-untrusted-data-vulnerability-in-kredis-json/82467"
  }, {
    "type" : "WEB",
    "url" : "https://discuss.rubyonrails.org/t/cve-2023-27531-possible-deserialization-of-untrusted-data-vulnerability-in-kredis-json/82467#post_1"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/rails/kredis"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rails/kredis/releases/tag/v1.3.0.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/rubysec/ruby-advisory-db/blob/master/gems/kredis/CVE-2023-27531.yml"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-502" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2023-06-09T22:40:54Z",
    "nvd_published_at" : "2025-01-09T01:15:07Z"
  }
}