MEDIUM 5.0

CVE-2026-10275: OpenSC Buffer Overflow in PKCS#11 Key Generation (5.0 Medium CVSS)

A buffer overflow vulnerability exists in OpenSC versions up to 0.26.1 within the pkcs11-tool component's key generation functionality. The flaw allows an attacker to overflow a buffer during certificate writing operations, potentially enabling remote code execution or data corruption. Exploitation requires user interaction and specific conditions, making it moderately difficult to weaponize, though a proof-of-concept has already been disclosed.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.0 MEDIUM · CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:L
Weaknesses (CWE)
CWE-119, CWE-120
Affected products
0 configuration(s)
Published / Modified
2026-06-01 / 2026-06-17

NVD description (verbatim)

A flaw has been found in OpenSC up to 0.26.1. This affects the function test_kpgen_certwrite of the file src/tools/pkcs11-tool.c of the component pkcs11-tool Key Generation Module. This manipulation causes buffer overflow. The attack is possible to be carried out remotely. The complexity of an attack is rather high. It is indicated that the exploitability is difficult. The exploit has been published and may be used. Patch name: 814f745b3b6d100295f65f1935edd33d520d33ab. It is recommended to apply a patch to fix this issue.

9 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

CVE-2026-10275 is a stack or heap buffer overflow (CWE-119, CWE-120) in the test_kpgen_certwrite function of src/tools/pkcs11-tool.c in OpenSC up to version 0.26.1. The vulnerability arises from insufficient bounds checking when processing certificate write operations during PKCS#11 key generation workflows. The attack surface is remote-facing, though exploitation requires a user to invoke the vulnerable code path, likely through crafted input to the key generation tool. The vulnerability has been patched in commit 814f745b3b6d100295f65f1935edd33d520d33ab.

Business impact

Organizations using OpenSC for cryptographic key management and PKCS#11 token operations face potential compromise of key generation workflows. In scenarios where OpenSC is deployed as part of an automated certificate issuance pipeline or HSM integration, a successful exploit could corrupt key material, disrupt service availability, or in worst case enable unauthorized key extraction. The impact is amplified if OpenSC processes untrusted or adversary-controlled certificate inputs, though typical enterprise deployments often restrict such inputs to trusted certificate authorities.

Affected systems

OpenSC versions 0.26.1 and earlier are affected. OpenSC is commonly used in Linux/Unix environments for smart card and hardware security module management, particularly in PKI infrastructure, government secure communications, and enterprise authentication systems. Organizations should audit their OpenSC deployment versions immediately to identify exposure.

Exploitability

Exploitation is categorized as difficult, with a CVSS score of 5.0 (Medium) reflecting attack complexity (AC:H) and the requirement for user interaction (UI:R). While a proof-of-concept has been published, successful exploitation in production environments likely requires attacker knowledge of the specific key generation flow, the ability to influence certificate input data, and local or network positioning to reach the vulnerable service. The high complexity suggests this is not a trivial remote worm vector, but remains a credible risk in targeted attacks against PKI operators.

Remediation

Apply patches immediately to remediate this vulnerability. Verify against the vendor advisory that your OpenSC build incorporates commit 814f745b3b6d100295f65f1935edd33d520d33ab or later. Organizations unable to patch immediately should disable or restrict access to the pkcs11-tool key generation module, particularly if it accepts untrusted certificate input, and monitor for suspicious activity in certificate generation logs.

Patch guidance

Update OpenSC to a version incorporating the fix commit 814f745b3b6d100295f65f1935edd33d520d33ab. Consult your Linux distribution's package repository or the OpenSC GitHub repository for the corresponding release version. If you maintain a custom OpenSC build, cherry-pick the commit or apply the equivalent patch. Test thoroughly in a non-production environment before rolling out to PKI infrastructure, as key generation tools are often part of critical workflows.

Detection guidance

Monitor for unexpected termination or crashes of pkcs11-tool processes, particularly those involving certificate write operations. Log anomalous arguments or input to pkcs11-tool key generation functions. If OpenSC is integrated into automated systems, watch for spurious job failures in certificate issuance pipelines. Memory sanitizers (ASAN) running on development or staging instances may flag buffer overflows before they reach production. Review system logs for core dumps or segmentation faults tied to OpenSC processes.

Why prioritize this

Although this vulnerability carries a CVSS score of 5.0 (Medium), it warrants prompt attention for organizations with PKI or cryptographic key infrastructure relying on OpenSC. The published proof-of-concept and the critical nature of the affected component (key generation) raise the operational risk above the raw score. Organizations should prioritize patching if OpenSC is exposed to any untrusted input or forms part of a user-facing service, but may deprioritize if OpenSC is isolated and used only in trusted offline key generation workflows.

Risk score, explained

The CVSS 3.1 score of 5.0 (Medium) reflects several mitigating factors: network-reachable attack surface (AV:N), but high complexity (AC:H), no privilege requirement (PR:N), yet mandatory user interaction (UI:R), and limited scope (S:U). The impact scope—low confidentiality, integrity, and availability (C:L/I:L/A:L)—suggests the buffer overflow may cause partial data corruption or denial of service rather than complete system takeover. However, buffer overflows in cryptographic tools carry inherent risk of key material exposure, so organizations should not discount this as a low-priority issue.

Frequently asked questions

How is OpenSC typically exposed to attack?

OpenSC is primarily exposed if it is integrated into network-facing certificate issuance services, automated PKI provisioning systems, or if users are tricked into processing untrusted certificate files with pkcs11-tool. In isolated offline key generation workflows where all inputs are controlled by authorized personnel, exposure is significantly reduced but not eliminated.

Does this vulnerability enable remote code execution?

The buffer overflow could potentially enable RCE, but only if the overflow is sufficiently controlled and the attacker can place executable code in memory. The CVSS vector (C:L/I:L/A:L) suggests the primary impact is limited confidentiality and integrity loss rather than full code execution. Real-world exploitability depends on the specific memory layout and mitigations (ASLR, DEP) in the target environment.

What is the difference between this and other OpenSC vulnerabilities?

CVE-2026-10275 is specific to the key generation module's certificate writing function. Other OpenSC CVEs may affect different components (PKCS#15, smart card parsing, etc.). Always cross-reference your OpenSC version against the CVE database to identify all applicable issues.

Do I need to regenerate existing cryptographic keys after patching?

If your existing keys were successfully generated before the vulnerability was exploited, regeneration is not strictly necessary for security purposes. However, if there is any suspicion that a malicious certificate was processed or keys were corrupted during the vulnerable period, cryptographic material should be re-issued. Consult your organization's incident response and cryptographic key management policies.

This analysis is provided for informational purposes and does not constitute legal, compliance, or investment advice. Readers are responsible for validating all technical claims against the OpenSC official repository and vendor advisories. CVSS scores and patch information reflect the state of publicly available data as of the publication date; always verify current status with authoritative sources. Organizations must conduct their own risk assessment and testing before deploying patches in production environments. No liability is assumed for use or misuse of this information. Source: NVD (public-domain), retrieved 2026-07-07. Analysis generated by SEC.co (claude-haiku-4-5).