public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: "Yoann Congal" <yoann.congal@smile.fr>
To: <hprajapati@mvista.com>, <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [scarthgap][PATCH] libxml-parser-perl: fix for CVE-2006-10003
Date: Sat, 28 Mar 2026 00:16:14 +0100	[thread overview]
Message-ID: <DHDY49JI73ZR.Y4O2QDGQW9JI@smile.fr> (raw)
In-Reply-To: <20260324050227.41834-1-hprajapati@mvista.com>

On Tue Mar 24, 2026 at 6:02 AM CET, Hitendra Prajapati via lists.openembedded.org wrote:
> Pick patch from [1].
>
> [1] https://security-tracker.debian.org/tracker/CVE-2006-10003
>
> More details :
> https://nvd.nist.gov/vuln/detail/CVE-2006-10003
>
> Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
> ---

Hello,

As far as I can tell, this CVE also applies to whinlatter and
master. You need to send the fix there before I can take it for
scarthgap and kirkstone.

Regards,

>  .../libxml-parser-perl/CVE-2006-10003.patch   | 73 +++++++++++++++++++
>  .../perl/libxml-parser-perl_2.47.bb           |  1 +
>  2 files changed, 74 insertions(+)
>  create mode 100644 meta/recipes-devtools/perl/libxml-parser-perl/CVE-2006-10003.patch
>
> diff --git a/meta/recipes-devtools/perl/libxml-parser-perl/CVE-2006-10003.patch b/meta/recipes-devtools/perl/libxml-parser-perl/CVE-2006-10003.patch
> new file mode 100644
> index 0000000000..e9a4b692d2
> --- /dev/null
> +++ b/meta/recipes-devtools/perl/libxml-parser-perl/CVE-2006-10003.patch
> @@ -0,0 +1,73 @@
> +From 08dd37c35ec5e64e26aacb8514437f54708f7fd1 Mon Sep 17 00:00:00 2001
> +From: Toddr Bot <toddbot@rinaldo.us>
> +Date: Mon, 16 Mar 2026 22:16:11 +0000
> +Subject: [PATCH] fix: off-by-one heap buffer overflow in st_serial_stack
> + growth check
> +
> +When st_serial_stackptr == st_serial_stacksize - 1, the old check
> +(stackptr >= stacksize) would not trigger reallocation. The subsequent
> +++stackptr then writes at index stacksize, one element past the
> +allocated buffer.
> +
> +Fix by checking stackptr + 1 >= stacksize so the buffer is grown
> +before the pre-increment write.
> +
> +Add a deep nesting test (600 levels) to exercise this code path.
> +
> +Fixes #39
> +
> +Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
> +
> +CVE: CVE-2006-10003
> +Upstream-Status: Backport [https://github.com/cpan-authors/XML-Parser/commit/08dd37c35ec5e64e26aacb8514437f54708f7fd1]
> +Signed-off-by: Hitendra Prajapati <hprajapati@mvista.com>
> +---
> + Expat/Expat.xs   |  2 +-
> + t/deep_nesting.t | 22 ++++++++++++++++++++++
> + 2 files changed, 23 insertions(+), 1 deletion(-)
> + create mode 100644 t/deep_nesting.t
> +
> +diff --git a/Expat/Expat.xs b/Expat/Expat.xs
> +index dbad380..f04a0cf 100644
> +--- a/Expat/Expat.xs
> ++++ b/Expat/Expat.xs
> +@@ -499,7 +499,7 @@ startElement(void *userData, const char *name, const char **atts)
> +     }
> +   }
> + 
> +-  if (cbv->st_serial_stackptr >= cbv->st_serial_stacksize) {
> ++  if (cbv->st_serial_stackptr + 1 >= cbv->st_serial_stacksize) {
> +     unsigned int newsize = cbv->st_serial_stacksize + 512;
> + 
> +     Renew(cbv->st_serial_stack, newsize, unsigned int);
> +diff --git a/t/deep_nesting.t b/t/deep_nesting.t
> +new file mode 100644
> +index 0000000..8237b5f
> +--- /dev/null
> ++++ b/t/deep_nesting.t
> +@@ -0,0 +1,22 @@
> ++BEGIN { print "1..1\n"; }
> ++
> ++# Test for deeply nested elements to exercise st_serial_stack reallocation.
> ++# This catches off-by-one errors in the stack growth check (GH #39).
> ++
> ++use XML::Parser;
> ++
> ++my $depth = 600;
> ++
> ++my $xml = '';
> ++for my $i (1 .. $depth) {
> ++    $xml .= "<e$i>";
> ++}
> ++for my $i (reverse 1 .. $depth) {
> ++    $xml .= "</e$i>";
> ++}
> ++
> ++my $p = XML::Parser->new;
> ++eval { $p->parse($xml) };
> ++
> ++print "not " if $@;
> ++print "ok 1\n";
> +-- 
> +2.50.1
> +
> diff --git a/meta/recipes-devtools/perl/libxml-parser-perl_2.47.bb b/meta/recipes-devtools/perl/libxml-parser-perl_2.47.bb
> index 803164f713..6a36b763a8 100644
> --- a/meta/recipes-devtools/perl/libxml-parser-perl_2.47.bb
> +++ b/meta/recipes-devtools/perl/libxml-parser-perl_2.47.bb
> @@ -8,6 +8,7 @@ DEPENDS += "expat"
>  
>  SRC_URI = "${CPAN_MIRROR}/authors/id/T/TO/TODDR/XML-Parser-${PV}.tar.gz \
>             file://0001-Makefile.PL-make-check_lib-cross-friendly.patch \
> +           file://CVE-2006-10003.patch \
>             "
>  
>  SRC_URI[sha256sum] = "ad4aae643ec784f489b956abe952432871a622d4e2b5c619e8855accbfc4d1d8"


-- 
Yoann Congal
Smile ECS



      reply	other threads:[~2026-03-27 23:16 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-24  5:02 [scarthgap][PATCH] libxml-parser-perl: fix for CVE-2006-10003 Hitendra Prajapati
2026-03-27 23:16 ` Yoann Congal [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DHDY49JI73ZR.Y4O2QDGQW9JI@smile.fr \
    --to=yoann.congal@smile.fr \
    --cc=hprajapati@mvista.com \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox