Skip to content
Heist/ feed
Back to feed
High

concat built-in can corrupt memory in vyper

Type: advisorySources: OSV

Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine. The `concat` built-in can write over the bounds of the memory buffer that was allocated for it and thus overwrite existing valid data. The root cause is that the `build_IR` for `concat` doesn't properly adhere to the API of copy functions (for `>=0.3.2` the `copy_bytes` function). A contract search was performed and no vulnerable contracts were found in production. The buffer overflow can result in the change of semantics of the contract. The overflow is length-dependent and thus it might go unnoticed during contract testing. However, certainly not all usages of concat will result in overwritten valid data as we require it to be in an internal function and close to the return statement where other memory allocations don't occur. This issue has been addressed in 0.4.0.

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2024-22419
Confirmed fixed CVEs
Not specified
Updated in this feed
5 Nov 2026, 03:30 UTC · Revision 1

Source evidence

concat built-in can corrupt memory in vyper

core-osv · Original source

Published 18 Jan 2024, 18:45 UTC

Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine. The `concat` built-in can write over the bounds of the memory buffer that was allocated for it and thus overwrite existing valid data. The root cause is that the `build_IR` for `concat` doesn't properly adhere to the API of copy functions (for `>=0.3.2` the `copy_bytes` function). A contract search was performed and no vulnerable contracts were found in production. The buffer overflow can result in the change of semantics of the contract. The overflow is length-dependent and thus it might go unnoticed during contract testing. However, certainly not all usages of concat will result in overwritten valid data as we require it to be in an internal function and close to the return statement where other memory allocations don't occur. This issue has been addressed in 0.4.0.

osv:CVE-2024-22419
Complete source record
{
  "id": "2717379a8380e70c0af30647dbd04a0470e64af645e1198837d8f1c2d4c23768",
  "url": "https://osv.dev/vulnerability/CVE-2024-22419",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "concat built-in can corrupt memory in vyper",
    "summary": "Vyper is a Pythonic Smart Contract Language for the Ethereum Virtual Machine. The `concat` built-in can write over the bounds of the memory buffer that was allocated for it and thus overwrite existing valid data. The root cause is that the `build_IR` for `concat` doesn't properly adhere to the API of copy functions (for `>=0.3.2` the `copy_bytes` function). A contract search was performed and no vulnerable contracts were found in production. The buffer overflow can result in the change of semantics of the contract. The overflow is length-dependent and thus it might go unnoticed during contract testing. However, certainly not all usages of concat will result in overwritten valid data as we require it to be in an internal function and close to the return statement where other memory allocations don't occur. This issue has been addressed in 0.4.0.",
    "evidence": "osv:CVE-2024-22419",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2024-22419",
      "aliases": [
        "CVE-2024-22419",
        "GHSA-2q8v-3gqq-4f8p",
        "PYSEC-2024-103"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/vyperlang/vyper",
              "type": "GIT",
              "events": [
                {
                  "introduced": "0"
                },
                {
                  "fixed": "55e18f6d128b2da8986adbbcccf1cd59a4b9ad6f"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:vyperlang:vyper:*:*:*:*:*:python:*:*",
                    "range": [
                      {
                        "introduced": "0"
                      },
                      {
                        "last_affected": "0.3.10"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "55e18f6d128b2da8986adbbcccf1cd59a4b9ad6f"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  }
                ]
              }
            }
          ],
          "versions": [
            "v0.3.10",
            "v0.3.10rc5",
            "v0.3.10rc4",
            "v0.3.10rc3",
            "v0.3.10rc2",
            "v0.3.10rc1",
            "v0.3.9",
            "v0.3.8",
            "v0.3.7",
            "v0.3.6",
            "v0.3.5",
            "v0.3.4",
            "pre-release",
            "v0.3.3",
            "v0.3.2",
            "v0.3.1",
            "v0.3.0",
            "v0.2.16",
            "v0.2.15",
            "v0.2.14",
            "v0.2.13",
            "v0.2.12",
            "v0.2.11",
            "v0.2.10",
            "v0.2.9",
            "v0.2.8",
            "v0.2.7",
            "v0.2.6",
            "v0.2.5",
            "v0.2.4",
            "v0.2.3",
            "v0.2.2",
            "v0.2.1",
            "0.2.1",
            "v0.2.0",
            "v0.1.0-beta.17",
            "v0.1.0-beta.16",
            "v0.1.0-beta.15",
            "v0.1.0-beta.14",
            "v0.1.0-beta.13",
            "v0.1.0-beta.12",
            "v0.1.0-beta.11",
            "v0.1.0-beta.10",
            "v0.1.0-beta.9",
            "v0.1.0-beta.8",
            "v0.1.0-beta.7",
            "v0.1.0-beta.6",
            "v0.1.0-beta.5",
            "v0.1.0-beta.3",
            "v0.1.0-beta.2",
            "v0.1.0-beta.1",
            "v0.0.4"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2024-22419.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:42.235119858Z",
      "provider": "osv",
      "references": [
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/22xxx/CVE-2024-22419.json",
        "https://github.com/vyperlang/vyper/security/advisories/GHSA-2q8v-3gqq-4f8p",
        "https://nvd.nist.gov/vuln/detail/CVE-2024-22419",
        "https://github.com/vyperlang/vyper/issues/3737",
        "https://github.com/vyperlang/vyper/commit/55e18f6d128b2da8986adbbcccf1cd59a4b9ad6f"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-120"
        ],
        "cna_assigner": "GitHub_M",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2024/22xxx/CVE-2024-22419.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2024-22419",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 509865,
  "published_at": "2024-01-18T18:45:55.731+00:00"
}