Open
fix(cve): 修复 CVE-2026-122056 在 openscap 中的漏洞 #42
infra_teamAdd on 7 days ago
fix(cve): 修复 CVE-2026-122056 在 openscap 中的漏洞 #42
Open
Total: 2 files changed+32-2
| @@ -0,0 +1,26 @@ | |||
| 1 | +From 113a2502c1b64614b2e6ec0dde7509a811a401ec Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: Matthew Burket <mburket@redhat.com> | ||
| 3 | +Date: Thu, 5 Nov 2026 12:08:41 -0600 | ||
| 4 | +Subject: [PATCH] fix: CVE-2026-122056 - off-by-one in ds_sds_mangle_filepath | ||
| 5 | + | ||
| 6 | +fix: CVE-2026-122056 - off-by-one in ds_sds_mangle_filepath | ||
| 7 | + | ||
| 8 | +Upstream-commit: https://github.com/OpenSCAP/openscap/commit/5f1f2bccd4b5f85e44a21a0ce3c854fbb65a2163 | ||
| 9 | +Signed-off-by: infra_team <zhaiwenjie1@huawei.com> | ||
| 10 | +--- | ||
| 11 | + src/DS/sds.c | 2 +- | ||
| 12 | + 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 13 | + | ||
| 14 | +diff --git a/src/DS/sds.c b/src/DS/sds.c | ||
| 15 | +index 81b7568e8..297199904 100644 | ||
| 16 | +--- a/src/DS/sds.c | ||
| 17 | ++++ b/src/DS/sds.c | ||
| 18 | +@@ -857,7 +857,7 @@ char* ds_sds_mangle_filepath(const char* filepath) | ||
| 19 | + | ||
| 20 | + // the string will grow 2x the size in the worst case (every char is /) | ||
| 21 | + // TODO: We can do better than this by counting the slashes | ||
| 22 | +- char* ret = malloc(strlen(filepath) * sizeof(char) * 2); | ||
| 23 | ++ char* ret = malloc((strlen(filepath) * sizeof(char) * 2) + 1); | ||
| 24 | + | ||
| 25 | + const char* src_it = filepath; | ||
| 26 | + char* dst_it = ret; | ||
| @@ -2,11 +2,12 @@ | |||
| 2 | 2 | ||
| 3 | Name: openscap | 3 | Name: openscap |
| 4 | Version: 1.4.6 | 4 | Version: 1.4.6 |
| 5 | -Release: 1 | 5 | +Release: 2 |
| 6 | Summary: An open source framework in order to provide a interface for using scap | 6 | Summary: An open source framework in order to provide a interface for using scap |
| 7 | License: LGPL-2.1-or-later | 7 | License: LGPL-2.1-or-later |
| 8 | URL: https://www.open-scap.org | 8 | URL: https://www.open-scap.org |
| 9 | Source0: https://github.com/OpenSCAP/openscap/archive/%{version}/%{name}-%{version}.tar.gz | 9 | Source0: https://github.com/OpenSCAP/openscap/archive/%{version}/%{name}-%{version}.tar.gz |
| 10 | +Patch0: backport-CVE-2026-122056.patch | ||
| 10 | 11 | ||
| 11 | BuildRequires: cmake >= 2.6 gcc gcc-c++ swig libxml2-devel libxslt-devel perl-generators perl-XML-Parser | 12 | BuildRequires: cmake >= 2.6 gcc gcc-c++ swig libxml2-devel libxslt-devel perl-generators perl-XML-Parser |
| 12 | BuildRequires: rpm-devel libgcrypt-devel pcre2-devel libacl-devel libselinux-devel libcap-devel libblkid-devel | 13 | BuildRequires: rpm-devel libgcrypt-devel pcre2-devel libacl-devel libselinux-devel libcap-devel libblkid-devel |
| @@ -67,7 +68,7 @@ BuildArch: noarch | |||
| 67 | This package includes help documentation and manuals related to openscap. | 68 | This package includes help documentation and manuals related to openscap. |
| 68 | 69 | ||
| 69 | %prep | 70 | %prep |
| 70 | -%autosetup -n %{name}-%{version} | 71 | +%autosetup -p1 -n %{name}-%{version} |
| 71 | 72 | ||
| 72 | %build | 73 | %build |
| 73 | %cmake -DWITH_PCRE2=ON -DENABLE_DOCS=ON | 74 | %cmake -DWITH_PCRE2=ON -DENABLE_DOCS=ON |
| @@ -119,6 +120,9 @@ pathfix.py -i %{__python3} -p -n $RPM_BUILD_ROOT%{_bindir}/scap-as-rpm | |||
| 119 | %{_mandir}/man8/* | 120 | %{_mandir}/man8/* |
| 120 | 121 | ||
| 121 | %changelog | 122 | %changelog |
| 123 | +* Thu Nov 12 2026 infra_team <zhaiwenjie1@huawei.com> - 1.4.6-2 | ||
| 124 | +- Fix CVE-2026-122056: one-byte heap buffer overflow in sds-compose | ||
| 125 | + (backport upstream commit 5f1f2bccd4) | ||
| 122 | * Sat Oct 24 2026 Funda Wang <fundawang@yeah.net> - 1.4.6-1 | 126 | * Sat Oct 24 2026 Funda Wang <fundawang@yeah.net> - 1.4.6-1 |
| 123 | - Update package to version 1.4.6 | 127 | - Update package to version 1.4.6 |
| 124 | - Fix CVE-2026-85518: path traversal when dumping SDS components | 128 | - Fix CVE-2026-85518: path traversal when dumping SDS components |