{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "source": "REFERENCES"
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "0358817ec74aeca654f83e7709c7720b14c5db59"
            }
          ],
          "repo": "https://github.com/opensc/opensc",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "VulnCheck",
    "cwe_ids": [
      "CWE-121",
      "CWE-122"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40528.json",
    "unresolved_ranges": [
      {
        "extracted_events": [
          {
            "fixed": "0.27.0"
          },
          {
            "fixed": "0358817ec74aeca654f83e7709c7720b14c5db59"
          }
        ],
        "source": "AFFECTED_FIELD"
      },
      {
        "extracted_events": [
          {
            "fixed": "0.27.0"
          }
        ],
        "source": "CPE_FIELD"
      },
      {
        "extracted_events": [
          {
            "fixed": "0.27.0"
          }
        ],
        "source": "DESCRIPTION"
      }
    ]
  },
  "details": "OpenSC before 0.27.0, fixed in commit 0358817, contains a stack and heap buffer overrun vulnerability in the do_key_value() function in src/pkcs15init/profile.c that allows attackers to corrupt memory by supplying a crafted profile configuration file. During pkcs15-init invocation, a key value entry beginning with '=' followed by more than sizeof(keybuf) characters is copied into keybuf via memcpy without a length check, causing both stack and heap buffer overruns.",
  "id": "CVE-2026-40528",
  "modified": "2026-08-05T03:30:23.242551993Z",
  "published": "2026-05-29T13:38:11.831Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40528.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40528"
    },
    {
      "type": "ADVISORY",
      "url": "https://www.vulncheck.com/advisories/opensc-buffer-overrun-in-do-key-value-via-profile-c"
    },
    {
      "type": "FIX",
      "url": "https://github.com/OpenSC/OpenSC/commit/0358817ec74aeca654f83e7709c7720b14c5db59"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/OpenSC/OpenSC"
    }
  ],
  "schema_version": "1.8.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:P/AC:H/AT:N/PR:N/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "OpenSC \u003c 0.27.0 Buffer Overrun in do_key_value() via profile.c"
}