libdbi-perl: Fix CVE-2026-9698
PATCH 1/5 libdbi-perl: Fix CVE-2026-9698
From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
[1] https://github.com/perl5-dbi/dbi/commit/bfe5d73c162d2d1f761a639a0aa33aad6a9eb54e
[2] https://nvd.nist.gov/vuln/detail/CVE-2026-9698
--- .../perl/libdbi-perl/CVE-2026-9698.patch | 43 +++++++++++++++++++ .../perl/libdbi-perl_1.643.bb | 1 + 2 files changed, 44 insertions(+) create mode 100644 meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-9698.patch
meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-9698.patch new file +43 -0
@@ -0,0 +1,43 @@ +From 216bf2cce660265bf7035610fbc67978d65a4ab3 Mon Sep 17 00:00:00 2001 +From: "H.Merijn Brand - Tux" <[email protected]> +Date: Wed, 27 May 2026 11:16:50 +0200 +Subject: [PATCH] Fix possible stack overflow (old issue already noted by Tim) + +CVE: CVE-2026-9698 +Upstream-Status: Backport [https://github.com/perl5-dbi/dbi/commit/bfe5d73c162d2d1f761a639a0aa33aad6a9eb54e] + +Backport Changes: + - Omit ChangeLog, dbixs_rev.h, and lib/DBI/Changes.pm release metadata because the target remains DBI 1.643. + - Omit the unrelated Makefile.PL documentation-generation update; the DBI.xs security hunk is unchanged. + +(cherry picked from commit bfe5d73c162d2d1f761a639a0aa33aad6a9eb54e) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + DBI.xs | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/DBI.xs b/DBI.xs +index 2cea4ac..c549d15 100644 +--- a/DBI.xs ++++ b/DBI.xs +@@ -3998,7 +3998,6 @@ XS(XS_DBI_dispatch) + SV **statement_svp = NULL; + const int is_warning = (!SvTRUE(err_sv) && strlen(SvPV_nolen(err_sv))==1); + const char *err_meth_name = meth_name; +- char intro[200]; + + if (meth_type == methtype_set_err) { + SV **sem_svp = hv_fetch((HV*)SvRV(h), "dbi_set_err_method", 18, GV_ADDWARN); +@@ -4006,10 +4005,8 @@ XS(XS_DBI_dispatch) + err_meth_name = SvPV_nolen(*sem_svp); + } + +- /* XXX change to vsprintf into sv directly */ +- sprintf(intro,"%s %s %s: ", HvNAME(DBIc_IMP_STASH(imp_xxh)), err_meth_name, +- SvTRUE(err_sv) ? "failed" : is_warning ? "warning" : "information"); +- msg = sv_2mortal(newSVpv(intro,0)); ++ msg = sv_2mortal(newSVpvf("%s %s %s: ", HvNAME(DBIc_IMP_STASH(imp_xxh)), err_meth_name, ++ SvTRUE(err_sv) ? "failed" : is_warning ? "warning" : "information")); + if (SvOK(DBIc_ERRSTR(imp_xxh))) + sv_catsv(msg, DBIc_ERRSTR(imp_xxh)); + else
meta-oe/recipes-devtools/perl/libdbi-perl_1.643.bb +1 -0
@@ -11,6 +11,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=10982c7148e0a012c0fd80534522f5c5" SRC_URI = "http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-${PV}.tar.gz \ file://CVE-2014-10402.patch \ + file://CVE-2026-9698.patch \ " SRC_URI[md5sum] = "352f80b1e23769c116082a90905d7398" SRC_URI[sha256sum] = "8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa"
Signature · 1 line
2.35.6
PATCH 2/5 libdbi-perl: Fix CVE-2026-10879
From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
[1] https://github.com/perl5-dbi/dbi/commit/af79036c07aa9a457971c0f4136e37c85dc20978
[2] https://security-tracker.debian.org/tracker/CVE-2026-10879
--- .../perl/libdbi-perl/CVE-2026-10879.patch | 34 +++++++++++++++++++ .../perl/libdbi-perl_1.643.bb | 1 + 2 files changed, 35 insertions(+) create mode 100644 meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-10879.patch
meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-10879.patch new file +34 -0
@@ -0,0 +1,34 @@ +From 2a69c8a256fa83dee2e532c97d3f60f39795c861 Mon Sep 17 00:00:00 2001 +From: "H.Merijn Brand - Tux" <[email protected]> +Date: Thu, 28 May 2026 14:14:50 +0200 +Subject: [PATCH] Replacing `?` with `:p#` in `preparse ()` with more than 9 + `?` causes buffer overflow + +`:p1` is length 3, `?` just 1, but `:p1003` is length 6! + +CVE: CVE-2026-10879 +Upstream-Status: Backport [https://github.com/perl5-dbi/dbi/commit/af79036c07aa9a457971c0f4136e37c85dc20978] + +Backport Changes: + - Omit ChangeLog, dbixs_rev.h, and lib/DBI/Changes.pm release metadata because the target remains DBI 1.643. + - Omit generated doc/DBI.3 and doc/DBI.man changes; the DBI.xs security hunk is unchanged. + +(cherry picked from commit af79036c07aa9a457971c0f4136e37c85dc20978) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + DBI.xs | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/DBI.xs b/DBI.xs +index c549d15..8858e21 100644 +--- a/DBI.xs ++++ b/DBI.xs +@@ -4201,7 +4201,7 @@ preparse(SV *dbh, const char *statement, IV ps_return, IV ps_accept, void *foo) + } + + /* XXX this allocation strategy won't work when we get to more advanced stuff */ +- new_stmt_sv = newSV(strlen(statement) * 3); ++ new_stmt_sv = newSV(strlen(statement) * 6 + 16); + sv_setpv(new_stmt_sv,""); + src = statement; + dest = SvPVX(new_stmt_sv);
meta-oe/recipes-devtools/perl/libdbi-perl_1.643.bb +1 -0
@@ -12,6 +12,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=10982c7148e0a012c0fd80534522f5c5" SRC_URI = "http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-${PV}.tar.gz \ file://CVE-2014-10402.patch \ file://CVE-2026-9698.patch \ + file://CVE-2026-10879.patch \ " SRC_URI[md5sum] = "352f80b1e23769c116082a90905d7398" SRC_URI[sha256sum] = "8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa"
Signature · 1 line
2.35.6
PATCH 3/5 libdbi-perl: Fix CVE-2026-14380
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
Backport the ordered upstream fix and regression-test chain from DBI 1.650. Add perl-module-load to RDEPENDS to satisfy the runtime dependency introduced by the primary fix's use of Module::Load.
[1] https://github.com/perl5-dbi/dbi/commit/b73d5d9901767fc1d16b6661ef08fbed4532e259
[2] https://github.com/perl5-dbi/dbi/commit/d982411aec73b3acfc4e9e465358bca9eb7fede8
[3] https://github.com/perl5-dbi/dbi/commit/f94685f415b08ea4b1f183d48430c4583c1c07d0
[4] https://github.com/perl5-dbi/dbi/commit/7949e551b3c7a8854926b6de84f6cc2ceafb2200
[5] https://nvd.nist.gov/vuln/detail/CVE-2026-14380
--- .../perl/libdbi-perl/CVE-2026-14380_p1.patch | 37 +++++++++++ .../perl/libdbi-perl/CVE-2026-14380_p2.patch | 65 +++++++++++++++++++ .../perl/libdbi-perl/CVE-2026-14380_p3.patch | 27 ++++++++ .../perl/libdbi-perl/CVE-2026-14380_p4.patch | 56 ++++++++++++++++ .../perl/libdbi-perl_1.643.bb | 5 ++ 5 files changed, 190 insertions(+) create mode 100644 meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14380_p1.patch create mode 100644 meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14380_p2.patch create mode 100644 meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14380_p3.patch create mode 100644 meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14380_p4.patch
meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14380_p1.patch new file +37 -0
@@ -0,0 +1,37 @@ +From b588d38661f00361bcf62b2665905ade844866ee Mon Sep 17 00:00:00 2001 +From: Robert Rothenberg <[email protected]> +Date: Wed, 1 Jul 2026 22:31:56 +0100 +Subject: [PATCH] Load profile packages using Module::Load [CVE-2026-14380] + +CVE: CVE-2026-14380 +Upstream-Status: Backport [https://github.com/perl5-dbi/dbi/commit/b73d5d9901767fc1d16b6661ef08fbed4532e259] + +(cherry picked from commit b73d5d9901767fc1d16b6661ef08fbed4532e259) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + lib/DBI/Profile.pm | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +diff --git a/lib/DBI/Profile.pm b/lib/DBI/Profile.pm +index f2cc886..4188462 100644 +--- a/lib/DBI/Profile.pm ++++ b/lib/DBI/Profile.pm +@@ -679,6 +679,7 @@ use vars qw(@ISA @EXPORT @EXPORT_OK $VERSION); + use Exporter (); + use UNIVERSAL (); + use Carp; ++use Module::Load (); + + use DBI qw(dbi_time dbi_profile dbi_profile_merge_nodes dbi_profile_merge); + +@@ -758,7 +759,9 @@ sub _auto_new { + } + } + +- eval "require $package" if $package; # silently ignores errors ++ eval { ++ Module::Load::load $package if $package; # silently ignores errors ++ }; + $package ||= $class; + + return $package->new(Path => \@Path, @args);
meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14380_p2.patch new file +65 -0
65 lines not on this page · raw message
meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14380_p3.patch new file +27 -0
@@ -0,0 +1,27 @@ +From cbd61112415aaa9db84d1af6d0bb3d0f61de8ce0 Mon Sep 17 00:00:00 2001 +From: Robert Rothenberg <[email protected]> +Date: Sat, 4 Jul 2026 13:34:20 +0100 +Subject: [PATCH] t/40profile.t increase number of tests in the plan + +CVE: CVE-2026-14380 +Upstream-Status: Backport [https://github.com/perl5-dbi/dbi/commit/f94685f415b08ea4b1f183d48430c4583c1c07d0] + +(cherry picked from commit f94685f415b08ea4b1f183d48430c4583c1c07d0) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + t/40profile.t | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/t/40profile.t b/t/40profile.t +index d736da7..ba24421 100644 +--- a/t/40profile.t ++++ b/t/40profile.t +@@ -31,7 +31,7 @@ BEGIN { + if $Config{osvers} =~ /xen/ # eg 2.6.18-4-xen-amd64 + and $ENV{AUTOMATED_TESTING}; + +- plan tests => 60; ++ plan tests => 61; + } + + $Data::Dumper::Indent = 1;
meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14380_p4.patch new file +56 -0
56 lines not on this page · raw message
meta-oe/recipes-devtools/perl/libdbi-perl_1.643.bb +5 -0
@@ -13,6 +13,10 @@ SRC_URI = "http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-${PV}.tar.gz \ file://CVE-2014-10402.patch \ file://CVE-2026-9698.patch \ file://CVE-2026-10879.patch \ + file://CVE-2026-14380_p1.patch \ + file://CVE-2026-14380_p2.patch \ + file://CVE-2026-14380_p3.patch \ + file://CVE-2026-14380_p4.patch \ " SRC_URI[md5sum] = "352f80b1e23769c116082a90905d7398" SRC_URI[sha256sum] = "8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa"
@@ -43,6 +47,7 @@ RDEPENDS:${PN}:class-target = " \ perl-module-exporter-heavy \ perl-module-dynaloader \ perl-module-io-dir \ + perl-module-load \ perl-module-scalar-util \ perl-module-universal \ "
Signature · 1 line
2.35.6
PATCH 4/5 libdbi-perl: Fix CVE-2026-14739
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
Backport the upstream hard limit for positional placeholders. This is a follow-up to CVE-2026-10879 and depends on the allocation fix from the preceding libdbi-perl commit.
Correct the upstream boundary check so that the documented maximum of 99999 placeholders is accepted and values above it are rejected. Add focused regression coverage for the 99999 and 100000 boundaries.
[1] https://github.com/perl5-dbi/dbi/commit/2b77c88b655e9539a592c71a61fb965fc0075395
[2] https://github.com/perl5-dbi/dbi/commit/af79036c07aa9a457971c0f4136e37c85dc20978
[3] https://nvd.nist.gov/vuln/detail/CVE-2026-14739
[4] https://nvd.nist.gov/vuln/detail/CVE-2026-10879
--- .../perl/libdbi-perl/CVE-2026-14739.patch | 170 ++++++++++++++++++ .../perl/libdbi-perl_1.643.bb | 1 + 2 files changed, 171 insertions(+) create mode 100644 meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14739.patch
meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14739.patch new file +170 -0
@@ -0,0 +1,170 @@ +From 57d0a1f66b9ed1b54f11af661da4719c43409497 Mon Sep 17 00:00:00 2001 +From: "H.Merijn Brand - Tux" <[email protected]> +Date: Sat, 4 Jul 2026 11:38:24 +0200 +Subject: [PATCH] Set a hard limit of 99999 on '?' placeholders + (CVE-2026-14739) + +CVE: CVE-2026-14739 +Upstream-Status: Backport [https://github.com/perl5-dbi/dbi/commit/2b77c88b655e9539a592c71a61fb965fc0075395] + +Backport Changes: + - Omit ChangeLog, dbixs_rev.h, lib/DBI/Changes.pm, and the DBI.pm version-number hunks because the target remains DBI 1.643. + - Omit regenerated doc/DBI.3, doc/DBI.html, doc/DBI.man, and doc/DBI.md files; retain the DBI.pm source-documentation and DBI.xs security changes unchanged. + - Correct the upstream boundary check to accept exactly 99999 placeholders and reject values above that documented limit; add t/60preparse.t regression coverage for 99999 and 100000 placeholders. + +(cherry picked from commit 2b77c88b655e9539a592c71a61fb965fc0075395) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + DBI.pm | 6 ++++-- + DBI.xs | 53 +++++++++++++++++++++++++++++++++-------------------- + t/60preparse.t | 13 ++++++++++++- + 3 files changed, 49 insertions(+), 23 deletions(-) + +diff --git a/DBI.pm b/DBI.pm +index d62a32d..b988e40 100644 +--- a/DBI.pm ++++ b/DBI.pm +@@ -7123,7 +7123,8 @@ a ref to an empty hash because they can't pre-determine the names. + It is possible that the keys in the hash returned by C<ParamValues> + are not exactly the same as those implied by the prepared statement. + For example, DBD::Oracle translates 'C<?>' placeholders into 'C<:pN>' +-where N is a sequence number starting at 1. ++where N is a sequence number starting at C<1> with a hard limit of ++C<99999>. + + * Values: + +@@ -7225,7 +7226,8 @@ integer. + It is also possible that the keys in the hash returned by + C<ParamArrays> are not exactly the same as those implied by the + prepared statement. For example, DBD::Oracle translates 'C<?>' +-placeholders into 'C<:pN>' where N is a sequence number starting at 1. ++placeholders into 'C<:pN>' where N is a sequence number starting at ++C<1> with a hard limit of C<99999>. + + =head3 C<RowsInCache> + +diff --git a/DBI.xs b/DBI.xs +index 8858e21..23ad34a 100644 +--- a/DBI.xs ++++ b/DBI.xs +@@ -4201,7 +4201,14 @@ preparse(SV *dbh, const char *statement, IV ps_return, IV ps_accept, void *foo) + } + + /* XXX this allocation strategy won't work when we get to more advanced stuff */ +- new_stmt_sv = newSV(strlen(statement) * 6 + 16); ++ /* The 7 is for length increase from '?' (length 1) to :p99999 (length 7) ++ * which imposes a limit of 99999 '?' placeholders POSIX style. Actual counts ++ * are a bit higher: ++ * using factor 5: :p1 .. :p1107 ++ * using factor 6: :p1 .. :p11106 ++ * using factor 7: :p1 .. :p111105 ++ * and that count is insane already */ ++ new_stmt_sv = newSV(strlen(statement) * 7 + 16); + sv_setpv(new_stmt_sv,""); + src = statement; + dest = SvPVX(new_stmt_sv); +@@ -4340,9 +4347,9 @@ preparse(SV *dbh, const char *statement, IV ps_return, IV ps_accept, void *foo) + continue; + } + +- if ( !(*src==':' && (PS_accept(DBIpp_ph_cn) || PS_accept(DBIpp_ph_cs))) +- && !(*src=='?' && PS_accept(DBIpp_ph_qm)) +- ){ ++ if ( !(*src==':' && (PS_accept(DBIpp_ph_cn) || PS_accept(DBIpp_ph_cs))) ++ && !(*src=='?' && PS_accept(DBIpp_ph_qm)) ++ ){ + if (*src == '\'' || *src == '"') + in_quote = *src; + *dest++ = *src++; +@@ -4361,12 +4368,18 @@ preparse(SV *dbh, const char *statement, IV ps_return, IV ps_accept, void *foo) + if (PS_return(DBIpp_ph_qm)) + ; + else if (PS_return(DBIpp_ph_cn)) { /* '?' -> ':p1' (etc) */ ++ if (idx > 99999) { ++ char buf[99]; ++ sprintf(buf, "preparse found more than 99999 '?' placeholders. Limit exceeded."); ++ set_err_char(dbh, imp_xxh, "1", 1, buf, 0, "preparse"); ++ return &PL_sv_undef; ++ } + sprintf(start,":p%d", idx++); + dest = start+strlen(start); + } + else if (PS_return(DBIpp_ph_sp)) { /* '?' -> '%s' */ +- *start = '%'; +- *dest++ = 's'; ++ *start = '%'; ++ *dest++ = 's'; + } + } + else if (isDIGIT(*src)) { /* :1 */ +@@ -4374,24 +4387,24 @@ preparse(SV *dbh, const char *statement, IV ps_return, IV ps_accept, void *foo) + style = ":1"; + + if (PS_return(DBIpp_ph_cn)) { /* ':1'->':p1' */ +- idx = pln; +- *dest++ = 'p'; +- while(isDIGIT(*src)) +- *dest++ = *src++; ++ idx = pln; ++ *dest++ = 'p'; ++ while(isDIGIT(*src)) ++ *dest++ = *src++; + } + else if (PS_return(DBIpp_ph_qm) /* ':1' -> '?' */ + || PS_return(DBIpp_ph_sp) /* ':1' -> '%s' */ + ) { +- PS_return(DBIpp_ph_qm) ? sprintf(start,"?") : sprintf(start,"%%s"); +- dest = start + strlen(start); +- if (pln != idx) { +- char buf[99]; +- sprintf(buf, "preparse found placeholder :%d out of sequence, expected :%d", pln, idx); +- set_err_char(dbh, imp_xxh, "1", 1, buf, 0, "preparse"); +- return &PL_sv_undef; +- } +- while(isDIGIT(*src)) src++; +- idx++; ++ PS_return(DBIpp_ph_qm) ? sprintf(start,"?") : sprintf(start,"%%s"); ++ dest = start + strlen(start); ++ if (pln != idx) { ++ char buf[99]; ++ sprintf(buf, "preparse found placeholder :%d out of sequence, expected :%d", pln, idx); ++ set_err_char(dbh, imp_xxh, "1", 1, buf, 0, "preparse"); ++ return &PL_sv_undef; ++ } ++ while(isDIGIT(*src)) src++; ++ idx++; + } + } + else if (isALNUM(*src)) /* :name */ +diff --git a/t/60preparse.t b/t/60preparse.t +index 6432feb..668dfa3 100755 +--- a/t/60preparse.t ++++ b/t/60preparse.t +@@ -11,7 +11,7 @@ BEGIN { + plan skip_all => 'preparse not supported for DBI::PurePerl'; + } + else { +- plan tests => 39; ++ plan tests => 43; + } + } + +@@ -71,6 +71,17 @@ is( pp($dbh, "a = :name", DBIpp_ph_sp, DBIpp_ph_cs), "a = %s" ); + + is( pp($dbh, "a = ? b = ? c = ?", DBIpp_ph_cn, DBIpp_ph_XX), "a = :p1 b = :p2 c = :p3" ); + ++my $max_placeholders = pp( ++ $dbh, "?" x 99999, DBIpp_ph_cn, DBIpp_ph_qm ++); ++ok(defined $max_placeholders, "accepts the documented limit of 99999 placeholders"); ++is(substr($max_placeholders, -7), ":p99999", "numbers the final allowed placeholder"); ++ ++is(pp($dbh, "?" x 100000, DBIpp_ph_cn, DBIpp_ph_qm), undef, ++ "rejects placeholders above the documented limit"); ++is($DBI::errstr, "preparse found more than 99999 '?' placeholders. Limit exceeded.", ++ "reports the placeholder limit"); ++ + ## Placeholders inside comments (should be ignored where comments style is accepted): + + is( pp( $dbh,
meta-oe/recipes-devtools/perl/libdbi-perl_1.643.bb +1 -0
@@ -17,6 +17,7 @@ SRC_URI = "http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-${PV}.tar.gz \ file://CVE-2026-14380_p2.patch \ file://CVE-2026-14380_p3.patch \ file://CVE-2026-14380_p4.patch \ + file://CVE-2026-14739.patch \ " SRC_URI[md5sum] = "352f80b1e23769c116082a90905d7398" SRC_URI[sha256sum] = "8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa"
Signature · 1 line
2.35.6
PATCH 5/5 libdbi-perl: Fix CVE-2026-14740
In reply to Hetvi Thakar -X (hthakar - E INFOCHIPS PRIVATE LIMITED at Cisco)From: Hetvi Thakar <[email protected]>
This patch applies the upstream fix as referenced in [2], using the commit shown in [1].
[1] https://github.com/perl5-dbi/dbi/commit/fc16f9e8b3dd5c65caf1867781ab2bfe2fadcc01
[2] https://nvd.nist.gov/vuln/detail/CVE-2026-14740
--- .../perl/libdbi-perl/CVE-2026-14740.patch | 40 +++++++++++++++++++ .../perl/libdbi-perl_1.643.bb | 1 + 2 files changed, 41 insertions(+) create mode 100644 meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14740.patch
meta-oe/recipes-devtools/perl/libdbi-perl/CVE-2026-14740.patch new file +40 -0
@@ -0,0 +1,40 @@ +From 016bd2b384ed34185a1770312124ceca0086d7a8 Mon Sep 17 00:00:00 2001 +From: Robert Rothenberg <[email protected]> +Date: Sat, 4 Jul 2026 10:49:42 +0100 +Subject: [PATCH] Fix out-of-bounds read in preparse when an initial comment is + deleted + +This fixes CVE-2026-14740 + +Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]> + +Signed-off-by: Robert Rothenberg <[email protected]> + +CVE: CVE-2026-14740 +Upstream-Status: Backport [https://github.com/perl5-dbi/dbi/commit/fc16f9e8b3dd5c65caf1867781ab2bfe2fadcc01] + +(cherry picked from commit fc16f9e8b3dd5c65caf1867781ab2bfe2fadcc01) +Signed-off-by: Hetvi Thakar <[email protected]> +--- + DBI.xs | 8 +++++++- + 1 file changed, 7 insertions(+), 1 deletion(-) + +diff --git a/DBI.xs b/DBI.xs +index 23ad34a..f40c17a 100644 +--- a/DBI.xs ++++ b/DBI.xs +@@ -4237,7 +4237,13 @@ preparse(SV *dbh, const char *statement, IV ps_return, IV ps_accept, void *foo) + } + if (in_comment == '/') + src++; +- src += (*src != '\n' || *(dest-1)=='\n') ? 1 : 0; ++ /* Only inspect the previously-emitted byte if one exists; ++ when an initial line comment is deleted, dest is still at ++ the start of the output buffer and *(dest-1) would read ++ one byte before it (OOB read). */ ++ src += (*src != '\n' ++ || (dest > SvPVX(new_stmt_sv) && *(dest-1)=='\n')) ++ ? 1 : 0; + in_comment = '\0'; + rt_comment = '\0'; + }
meta-oe/recipes-devtools/perl/libdbi-perl_1.643.bb +1 -0
@@ -18,6 +18,7 @@ SRC_URI = "http://search.cpan.org/CPAN/authors/id/T/TI/TIMB/DBI-${PV}.tar.gz \ file://CVE-2026-14380_p3.patch \ file://CVE-2026-14380_p4.patch \ file://CVE-2026-14739.patch \ + file://CVE-2026-14740.patch \ " SRC_URI[md5sum] = "352f80b1e23769c116082a90905d7398" SRC_URI[sha256sum] = "8a2b993db560a2c373c174ee976a51027dd780ec766ae17620c20393d2e836fa"
Signature · 1 line
2.35.6