{
  "affected": [
    {
      "ranges": [
        {
          "database_specific": {
            "cpe": "cpe:2.3:a:opensc_project:opensc:*:*:*:*:*:*:*:*",
            "extracted_events": [
              {
                "introduced": "0"
              },
              {
                "fixed": "0.27.0"
              }
            ],
            "source": [
              "CPE_RANGE",
              "REFERENCES"
            ]
          },
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "aca07679a6dd281ee6411f5e7de2ed0ee796bee8"
            },
            {
              "fixed": "3f24f0b48a481a8cf2e46059d8238a283ddc1c13"
            }
          ],
          "repo": "https://github.com/opensc/opensc",
          "type": "GIT"
        }
      ]
    }
  ],
  "database_specific": {
    "cna_assigner": "VulnCheck",
    "cwe_ids": [
      "CWE-121"
    ],
    "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40510.json",
    "unresolved_ranges": [
      {
        "extracted_events": [
          {
            "fixed": "3f24f0b48a481a8cf2e46059d8238a283ddc1c13"
          }
        ],
        "source": "AFFECTED_FIELD"
      }
    ]
  },
  "details": "OpenSC before 0.27.0-rc1, fixed in commit 3f24f0b, contains a stack buffer overflow vulnerability in piv_process_history() in src/libopensc/card-piv.c that allows physically present attackers to trigger memory corruption by presenting a crafted PIV smart card or USB device returning a URL field longer than 118 bytes in the Key History Object ASN.1 response.",
  "id": "CVE-2026-40510",
  "modified": "2026-07-08T05:36:19.671298482Z",
  "published": "2026-05-29T13:26:40.459Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/40xxx/CVE-2026-40510.json"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-40510"
    },
    {
      "type": "ADVISORY",
      "url": "https://www.vulncheck.com/advisories/opensc-stack-buffer-overflow-via-piv-process-history-in-card-piv-c"
    },
    {
      "type": "REPORT",
      "url": "https://github.com/OpenSC/OpenSC/pull/3558"
    },
    {
      "type": "FIX",
      "url": "https://github.com/OpenSC/OpenSC/commit/3f24f0b48a481a8cf2e46059d8238a283ddc1c13"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/OpenSC/OpenSC"
    }
  ],
  "schema_version": "1.7.5",
  "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-rc1 Stack Buffer Overflow via piv_process_history() in card-piv.c"
}