diff mbox series

[meta-oe,scarthgap,2/2] libdbi-perl: fix for CVE-2026-88816

Message ID 20261123051821.43934-2-hprajapati@mvista.com
State New
Headers show
Series [meta-oe,scarthgap,1/2] libdbi-perl: fix for CVE-2026-88815 | expand

Commit Message

Hitendra Prajapati Nov. 23, 2026, 5:18 a.m. UTC
Pick the patch from [1], also referenced in the Debian report [2].

[1] https://github.com/perl5-dbi/dbi/commit/70962570212dc60a5428098cf2a0462ad5945851
[2] https://security-tracker.debian.org/tracker/CVE-2026-88816

Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
---
 .../perl/libdbi-perl/CVE-2026-88816.patch     | 59 +++++++++++++++++++
 .../perl/libdbi-perl_1.643.bb                 |  1 +
 2 files changed, 60 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-88816.patch
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-88816.patch b/meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-88816.patch
new file mode 100644
index 0000000000..b4b0ddf32e
--- /dev/null
+++ b/meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-88816.patch
@@ -0,0 +1,59 @@ 
+From: "H.Merijn Brand - Tux" <linux@tux.freedom.nl>
+Date: Thu, 10 Sep 2026 11:26:24 +0200
+Subject: Fix FetchHashKeyName on IV/NV (CVE-2026-88816) (reported by Raj)
+
+Origin: https://github.com/perl5-dbi/dbi/commit/70962570212dc60a5428098cf2a0462ad5945851
+Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2026-88816
+
+Backport Changes:
+
+The changes to ChangeLog, dbixs_rev.h, t/90sql_type_cast.t and lib/DBI/Changes.pm have been
+omitted because they are not applicable to our current version.
+Therefore, these files are not included in this patch.
+
+CVE: CVE-2026-88816
+Upstream-Status: Backport [https://github.com/perl5-dbi/dbi/commit/70962570212dc60a5428098cf2a0462ad5945851]
+Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
+---
+ DBI.xs      |  2 +-
+ t/06attrs.t | 11 +++++++++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/DBI.xs b/DBI.xs
+index 53889f0..5b770ef 100644
+--- a/DBI.xs
++++ b/DBI.xs
+@@ -5332,7 +5332,7 @@ fetchrow_hashref(sth, keyattrib=Nullch)
+     if (!keyattrib || !*keyattrib) {
+         SV *kn = DBIc_FetchHashKeyName(imp_sth);
+         if (kn && SvOK(kn))
+-            keyattrib = SvPVX(kn);
++            keyattrib = SvPV_nolen(kn); /* Also force stringification */
+         else
+             keyattrib = "NAME";
+     }
+diff --git a/t/06attrs.t b/t/06attrs.t
+index 835e7db..37dad15 100644
+--- a/t/06attrs.t
++++ b/t/06attrs.t
+@@ -328,6 +328,17 @@ check_inherited($drh, "ReadOnly", 1, 0);
+ 
+ }
+ 
++{   # CVE-2026-88816
++    my $h = DBI->connect("dbi:ExampleP:", "", "", { RaiseError => 0, PrintError => 0 });
++    $dbh->{FetchHashKeyName} = 42;
++    my $s = $dbh->prepare("select mode,size,name from .");
++    $s->execute;
++    my @err;
++    local $SIG{__DIE__} = sub { push @err => @_ };
++    eval { $s->fetchrow_hashref; };
++    like($err[0], qr{Can't use (?:attribute '42'|an undefined)}, "Invalid HashKeyName");
++}
++
+ done_testing();
+ 
+ 1;
+-- 
+2.50.1
+
diff --git a/meta-oe/recipes-devtools/perl/libdbi-perl_1.643.bb b/meta-oe/recipes-devtools/perl/libdbi-perl_1.643.bb
index 5328d6b8bd..3072ba76f8 100644
--- a/meta-oe/recipes-devtools/perl/libdbi-perl_1.643.bb
+++ b/meta-oe/recipes-devtools/perl/libdbi-perl_1.643.bb
@@ -20,6 +20,7 @@  SRC_URI = "http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-${PV}.tar.gz \
            file://CVE-2026-14739.patch \
            file://CVE-2026-14740.patch \
            file://CVE-2026-88815.patch \
+           file://CVE-2026-88816.patch \
            "
 SRC_URI[md5sum] = "352f80b1e23769c116082a90905d7398"
 SRC_URI[sha256sum] = "8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa"