Medium
Security advisory
A flaw was found in openCryptoki. The openCryptoki Soft token does not check if an EC key is valid when an EC key is created via C_CreateObject, nor when C_DeriveKey is used with ECDH public data. This may allow a malicious user to extract the private key by performing an invalid curve attack.
- Products
- Not specified
- Affected versions
- Not specified
- Fixed versions
- Not specified
- CVEs
- CVE-2021-3798
- Confirmed fixed CVEs
- Not specified
- Updated in this feed
- 31 Oct 2026, 12:41 UTC · Revision 1
Source evidence
A flaw was found in openCryptoki. The openCryptoki Soft token does not check if an EC key is valid when an EC key is created via C_CreateObject, nor when C_DeriveKey is used with ECDH public data. This may allow a malicious user to extract the private key by performing an invalid curve attack.
osv:CVE-2021-3798
Complete source record
{
"id": "e646092f06ea2318606ef923abbe51086f0d853dbea1410b2d5a38de9ae356bf",
"url": "https://osv.dev/vulnerability/CVE-2021-3798",
"method": "structured",
"payload": {
"kind": "advisory",
"title": "CVE-2021-3798",
"summary": "A flaw was found in openCryptoki. The openCryptoki Soft token does not check if an EC key is valid when an EC key is created via C_CreateObject, nor when C_DeriveKey is used with ECDH public data. This may allow a malicious user to extract the private key by performing an invalid curve attack.",
"evidence": "osv:CVE-2021-3798",
"products": [],
"severity": "medium",
"structured": {
"id": "CVE-2021-3798",
"aliases": [
"CVE-2021-3798"
],
"metrics": [
{
"type": "CVSS_V3",
"score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N"
}
],
"affected": [
{
"ranges": [
{
"repo": "https://github.com/opencryptoki/opencryptoki",
"type": "GIT",
"events": [
{
"introduced": "0"
},
{
"fixed": "8ab1059bd29b28dbeeae151310cc9beca88d1cb1"
},
{
"fixed": "4e3b43c3d8844402c04a66b55c6c940f965109f0"
}
],
"database_specific": {
"extracted_events": [
{
"cpe": "cpe:2.3:a:opencryptoki_project:opencryptoki:*:*:*:*:*:*:*:*",
"range": [
{
"introduced": "0"
},
{
"fixed": "3.17.0"
}
],
"source": "CPE_RANGE"
},
{
"range": [
{
"fixed": "4e3b43c3d8844402c04a66b55c6c940f965109f0"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
}
],
"versions": [
"v3.16.0",
"v3.15.1",
"v3.15.0",
"v3.14.0",
"v3.13.0",
"v3.12.1",
"v3.12.0",
"v3.11.1",
"v3.11.0",
"v3.10.0",
"v3.9.0",
"v3.8.2",
"v3.8.0",
"v3.8.1",
"v3.7.0",
"v3.6.2",
"v3.6.1",
"v3.6",
"v3.5",
"v3.4.1",
"v3.4",
"v3.3",
"v3.2",
"v3.1",
"v2.4.3.1",
"v3.0",
"v2.4.3",
"v2.3.3",
"v2.3.2"
],
"database_specific": {
"source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-3798.json",
"vanir_signatures": [
{
"id": "CVE-2021-3798-a513978c",
"digest": {
"length": 744,
"function_hash": "227030742641434579281486111687377295738"
},
"source": "https://github.com/opencryptoki/opencryptoki/commit/4e3b43c3d8844402c04a66b55c6c940f965109f0",
"target": {
"file": "usr/lib/soft_stdll/soft_specific.c",
"function": "fill_ec_key_from_privkey"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
},
{
"id": "CVE-2021-3798-bd9a54be",
"digest": {
"length": 572,
"function_hash": "167809855859216864502066761829954412651"
},
"source": "https://github.com/opencryptoki/opencryptoki/commit/4e3b43c3d8844402c04a66b55c6c940f965109f0",
"target": {
"file": "usr/lib/soft_stdll/soft_specific.c",
"function": "fill_ec_key_from_pubkey"
},
"deprecated": false,
"signature_type": "Function",
"signature_version": "v1"
},
{
"id": "CVE-2021-3798-e4f487ff",
"digest": {
"threshold": 0.9,
"line_hashes": [
"241914080668320224096387584555820029697",
"294749349881809309464343043695379726799",
"155825835143266065778361583573477398571",
"241914080668320224096387584555820029697",
"151463854885936926283904390379390757917",
"273130886101318911504810936600417370356"
]
},
"source": "https://github.com/opencryptoki/opencryptoki/commit/4e3b43c3d8844402c04a66b55c6c940f965109f0",
"target": {
"file": "usr/lib/soft_stdll/soft_specific.c"
},
"deprecated": false,
"signature_type": "Line",
"signature_version": "v1"
}
],
"vanir_signatures_modified": "2026-10-20T14:12:44Z"
}
}
],
"modified": "2026-10-20T14:12:44.465005971Z",
"provider": "osv",
"references": [
"https://access.redhat.com/security/cve/CVE-2021-3798",
"https://bugzilla.redhat.com/show_bug.cgi?id=1990591",
"https://github.com/opencryptoki/opencryptoki/commit/4e3b43c3d8844402c04a66b55c6c940f965109f0",
"https://github.com/opencryptoki/opencryptoki/pull/402"
],
"provider_metadata": {}
},
"related_cves": [
{
"value": "CVE-2021-3798",
"evidence": "/id"
}
],
"security_relevant": true,
"severity_evidence": "/severity/0/score"
},
"source_id": "core-osv",
"document_id": 388719,
"published_at": "2022-08-23T16:15:09.93+00:00"
}