Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-21309

Redis is an open-source, in-memory database that persists on disk. In affected versions of Redis an integer overflow bug in 32-bit Redis version 4.0 or newer could be exploited to corrupt the heap and potentially result with remote code execution. Redis 4.0 or newer uses a configurable limit for the maximum supported bulk input size. By default, it is 512MB which is a safe value for all platforms. If the limit is significantly increased, receiving a large request from a client may trigger several integer overflow scenarios, which would result with buffer overflow and heap corruption. We believe this could in certain conditions be exploited for remote code execution. By default, authenticated Redis users have access to all configuration parameters and can therefore use the “CONFIG SET proto-max-bulk-len” to change the safe default, making the system vulnerable. **This problem only affects 32-bit Redis (on a 32-bit system, or as a 32-bit executable running on a 64-bit system).** The problem is fixed in version 6.2, and the fix is back ported to 6.0.11 and 5.0.11. Make sure you use one of these versions if you are running 32-bit Redis. An additional workaround to mitigate the problem without patching the redis-server executable is to prevent clients from directly executing `CONFIG SET`: Using Redis 6.0 or newer, ACL configuration can be used to block the command. Using older versions, the `rename-command` configuration directive can be used to rename the command to a random stri

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-21309
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 12:42 UTC · Revision 1

Source evidence

CVE-2021-21309

core-osv · Original source

Published 26 Feb 2021, 22:15 UTC

Redis is an open-source, in-memory database that persists on disk. In affected versions of Redis an integer overflow bug in 32-bit Redis version 4.0 or newer could be exploited to corrupt the heap and potentially result with remote code execution. Redis 4.0 or newer uses a configurable limit for the maximum supported bulk input size. By default, it is 512MB which is a safe value for all platforms. If the limit is significantly increased, receiving a large request from a client may trigger several integer overflow scenarios, which would result with buffer overflow and heap corruption. We believe this could in certain conditions be exploited for remote code execution. By default, authenticated Redis users have access to all configuration parameters and can therefore use the “CONFIG SET proto-max-bulk-len” to change the safe default, making the system vulnerable. **This problem only affects 32-bit Redis (on a 32-bit system, or as a 32-bit executable running on a 64-bit system).** The problem is fixed in version 6.2, and the fix is back ported to 6.0.11 and 5.0.11. Make sure you use one of these versions if you are running 32-bit Redis. An additional workaround to mitigate the problem without patching the redis-server executable is to prevent clients from directly executing `CONFIG SET`: Using Redis 6.0 or newer, ACL configuration can be used to block the command. Using older versions, the `rename-command` configuration directive can be used to rename the command to a random stri

osv:CVE-2021-21309
Complete source record
{
  "id": "18797a380dd6943273062b82b0d900367be6747884f9d5449663d341315664df",
  "url": "https://osv.dev/vulnerability/CVE-2021-21309",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-21309",
    "summary": "Redis is an open-source, in-memory database that persists on disk. In affected versions of Redis an integer overflow bug in 32-bit Redis version 4.0 or newer could be exploited to corrupt the heap and potentially result with remote code execution. Redis 4.0 or newer uses a configurable limit for the maximum supported bulk input size. By default, it is 512MB which is a safe value for all platforms. If the limit is significantly increased, receiving a large request from a client may trigger several integer overflow scenarios, which would result with buffer overflow and heap corruption. We believe this could in certain conditions be exploited for remote code execution. By default, authenticated Redis users have access to all configuration parameters and can therefore use the “CONFIG SET proto-max-bulk-len” to change the safe default, making the system vulnerable. **This problem only affects 32-bit Redis (on a 32-bit system, or as a 32-bit executable running on a 64-bit system).** The problem is fixed in version 6.2, and the fix is back ported to 6.0.11 and 5.0.11. Make sure you use one of these versions if you are running 32-bit Redis. An additional workaround to mitigate the problem without patching the redis-server executable is to prevent clients from directly executing `CONFIG SET`: Using Redis 6.0 or newer, ACL configuration can be used to block the command. Using older versions, the `rename-command` configuration directive can be used to rename the command to a random stri",
    "evidence": "osv:CVE-2021-21309",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-21309",
      "aliases": [
        "CVE-2021-21309",
        "GHSA-hgj8-vff2-7cjf"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/redis/redis",
              "type": "GIT",
              "events": [
                {
                  "introduced": "05b81d2b02578d432329c87c93f975e582d14c0e"
                },
                {
                  "fixed": "562787e4c9953a8780c925238c409adc9316d3dc"
                },
                {
                  "introduced": "17dfd7cabbf7954f92b7a1243d4bb27fee5d4500"
                },
                {
                  "fixed": "91ffe99e03edee658b1e3129344f1f4d633f3104"
                },
                {
                  "fixed": "c992857618db99776917f10bf4f2345a5fdc78b0"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:redislabs:redis:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "4.0"
                      },
                      {
                        "fixed": "5.0.11"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:redislabs:redis:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "6.0.0"
                      },
                      {
                        "fixed": "6.0.11"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "c992857618db99776917f10bf4f2345a5fdc78b0"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "6.0.10",
            "6.0.9",
            "6.0.8",
            "6.0.7",
            "6.0.6",
            "6.0.5",
            "6.0.4",
            "6.0.3",
            "6.0.2",
            "6.0.1",
            "6.0.0"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21309.json",
            "vanir_signatures": [
              {
                "id": "CVE-2021-21309-414f816f",
                "digest": {
                  "length": 309,
                  "function_hash": "162442883481463849579488174693560995025"
                },
                "source": "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
                "target": {
                  "file": "src/zmalloc.c",
                  "function": "zmalloc"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21309-5386c2c0",
                "digest": {
                  "length": 1106,
                  "function_hash": "260440085641522061331649184678664968415"
                },
                "source": "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
                "target": {
                  "file": "src/sds.c",
                  "function": "sdsnewlen"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21309-53e80ebd",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "140111483799751246469237238832256467932",
                    "17600801471083750387602519450293275203",
                    "224045110869036203012801583554761488312",
                    "315363268007418506557619481679672270861",
                    "303460625829651648087669759719106621861",
                    "228611787393857458153510141416591312872",
                    "294997011026131460215101352051769566860",
                    "28594521319387620153068980355147400772",
                    "206487578450874214815309161369473839092",
                    "157531595861398670596954977822636651244",
                    "31246346550257045727525607416992409872",
                    "98874526194134075002902230987257544758",
                    "269607353631299574926953176789883336367",
                    "65596530591154715126891456810266858280",
                    "167974282991432606476565394323103784970",
                    "78969616723859568766668740487437294270",
                    "243738930950891552922635536143120894022",
                    "81362257055698154026064476581532642270",
                    "65142904068933393787078755830567256425"
                  ]
                },
                "source": "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
                "target": {
                  "file": "src/zmalloc.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21309-5c9a922e",
                "digest": {
                  "length": 186,
                  "function_hash": "36531836934030660320884078987017000419"
                },
                "source": "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
                "target": {
                  "file": "src/zmalloc.c",
                  "function": "zmalloc_no_tcache"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21309-8926a47f",
                "digest": {
                  "length": 882,
                  "function_hash": "77049328389506436351877267381064357410"
                },
                "source": "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
                "target": {
                  "file": "src/sds.c",
                  "function": "sdsMakeRoomFor"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21309-96024cd2",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "210580165149845695958147994511135829560",
                    "198954702845113088911728451563100702806",
                    "14136491472624314591195648626564470756",
                    "114274532327616662425140210456186963731"
                  ]
                },
                "source": "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
                "target": {
                  "file": "src/config.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21309-9bda0a7f",
                "digest": {
                  "length": 313,
                  "function_hash": "40168322963619775624804847581357684154"
                },
                "source": "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
                "target": {
                  "file": "src/zmalloc.c",
                  "function": "zcalloc"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21309-b1d57af2",
                "digest": {
                  "length": 737,
                  "function_hash": "223415984698831932528998917404214754295"
                },
                "source": "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
                "target": {
                  "file": "src/zmalloc.c",
                  "function": "zrealloc"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21309-f0cd8cb0",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "1452624329680069441985546870305680700",
                    "111685388701570442694269714391636465554",
                    "324260494569421602839114705133928459984",
                    "309820509046219063941975706467352758695",
                    "208529237905859139551911723870695439926",
                    "303256918540100749521501629958001115569",
                    "258808421794126014988701352486655193498",
                    "13729656265427882877694105429405794417",
                    "331875946291020752929235271174006939086",
                    "174893336295906489992548027949380915917",
                    "106181083073152361928286201228524514033"
                  ]
                },
                "source": "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
                "target": {
                  "file": "src/sds.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-20T14:18:40Z"
          }
        }
      ],
      "modified": "2026-10-20T14:18:40.047092511Z",
      "provider": "osv",
      "references": [
        "https://github.com/redis/redis/security/advisories/GHSA-hgj8-vff2-7cjf",
        "https://security.gentoo.org/glsa/202103-02",
        "https://github.com/redis/redis/commit/c992857618db99776917f10bf4f2345a5fdc78b0",
        "https://github.com/redis/redis/pull/8522"
      ],
      "provider_metadata": {}
    },
    "related_cves": [
      {
        "value": "CVE-2021-21309",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 388801,
  "published_at": "2021-02-26T22:15:19.457+00:00"
}