Skip to content

Commit 8d3720d

Browse files
azurelinux-securityKanishk-Bansalkgodara912
authored
[AutoPR- Security] Patch opensc for CVE-2026-10275 [LOW] (microsoft#17750)
Co-authored-by: Kanishk Bansal <103916909+Kanishk-Bansal@users.noreply.github.com> Co-authored-by: kgodara912 <kshigodara@outlook.com>
1 parent 1d5af6f commit 8d3720d

2 files changed

Lines changed: 48 additions & 6 deletions

File tree

SPECS/opensc/CVE-2026-10275.patch

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
From 85f3528adc97367ff43871aa245cafd16376ba36 Mon Sep 17 00:00:00 2001
2+
From: Frank Morgner <frankmorgner@gmail.com>
3+
Date: Mon, 11 May 2026 11:00:28 +0200
4+
Subject: [PATCH] pkcs11-tool: prevent buffer overflow
5+
6+
Reported by @HMF2021 hippofu999
7+
8+
Signed-off-by: Azure Linux Security Servicing Account <azurelinux-security@microsoft.com>
9+
Upstream-reference: https://github.com/OpenSC/OpenSC/commit/814f745b3b6d100295f65f1935edd33d520d33ab.patch
10+
---
11+
src/tools/pkcs11-tool.c | 6 ++++++
12+
1 file changed, 6 insertions(+)
13+
14+
diff --git a/src/tools/pkcs11-tool.c b/src/tools/pkcs11-tool.c
15+
index a5f63d9..28e3a03 100644
16+
--- a/src/tools/pkcs11-tool.c
17+
+++ b/src/tools/pkcs11-tool.c
18+
@@ -1342,6 +1342,8 @@ int main(int argc, char * argv[])
19+
}
20+
if (opt_uri->id) {
21+
opt_object_id_len = opt_uri->id_len;
22+
+ if (opt_object_id_len > sizeof(opt_object_id))
23+
+ util_fatal("URI's object ID too long");
24+
memcpy(opt_object_id, opt_uri->id, opt_object_id_len);
25+
}
26+
}
27+
@@ -9617,6 +9619,10 @@ static CK_SESSION_HANDLE test_kpgen_certwrite(CK_SLOT_ID slot, CK_SESSION_HANDLE
28+
return session;
29+
}
30+
opt_object_id_len = (size_t) i;
31+
+ if (opt_object_id_len > sizeof(opt_object_id)) {
32+
+ fprintf(stderr, "ERR: object ID too long\n");
33+
+ return session;
34+
+ }
35+
memcpy(opt_object_id, tmp, opt_object_id_len);
36+
37+
/* This is done in NSS */
38+
--
39+
2.45.4
40+

SPECS/opensc/opensc.spec

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Name: opensc
22
Version: 0.27.1
3-
Release: 1%{?dist}
3+
Release: 2%{?dist}
44
Summary: Smart card library and applications
55

66
License: LGPL-2.1-or-later AND BSD-3-Clause
@@ -9,9 +9,10 @@ Vendor: Microsoft Corporation
99
Distribution: Azure Linux
1010
Source0: https://github.com/OpenSC/OpenSC/releases/download/%{version}/%{name}-%{version}.tar.gz
1111
Source1: opensc.module
12-
Patch1: opensc-0.19.0-pinpad.patch
12+
Patch0: opensc-0.19.0-pinpad.patch
1313
# File caching by default (#2000626)
14-
Patch8: %{name}-0.22.0-file-cache.patch
14+
Patch1: %{name}-0.22.0-file-cache.patch
15+
Patch2: CVE-2026-10275.patch
1516

1617
BuildRequires: make
1718
BuildRequires: pcsc-lite-devel
@@ -48,9 +49,7 @@ every software/card that does so, too.
4849

4950

5051
%prep
51-
%setup -q
52-
%patch 1 -p1 -b .pinpad
53-
%patch 8 -p1 -b .file-cache
52+
%autosetup -p1
5453

5554
# The test-pkcs11-tool-allowed-mechanisms already works in Fedora
5655
sed -i -e '/XFAIL_TESTS/,$ {
@@ -204,6 +203,9 @@ rm %{buildroot}%{_mandir}/man1/opensc-notify.1*
204203

205204

206205
%changelog
206+
* Wed Jun 17 2026 Azure Linux Security Servicing Account <azurelinux-security@microsoft.com> - 0.27.1-2
207+
- Patch for CVE-2026-10275
208+
207209
* Tue Mar 31 2026 CBL-Mariner Servicing Account <cblmargh@microsoft.com> - 0.27.1-1
208210
- Auto-upgrade to 0.27.1 - for CVE-2025-13763, CVE-2025-49010, CVE-2025-66215, CVE-2025-66038, CVE-2025-66037
209211

0 commit comments

Comments
 (0)