public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Emmanuel Seyman <emmanuel@seyman.fr>
To: git-commits@fedoraproject.org
Subject: [rpms/perl-XML-Bare] f44: Include two security fixes for XML-Bare =< 0.53
Date: Sun, 30 Aug 2026 09:20:00 GMT	[thread overview]
Message-ID: <178808160000.1.9878284496376625908.rpms-perl-XML-Bare-2d11b959912b@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/perl-XML-Bare
Branch : f44
Commit : 2d11b959912b005342aa14b3f4900c5e3b8e6677
Author : Emmanuel Seyman <emmanuel@seyman.fr>
Date   : 2026-08-30T11:19:45+02:00
Stats  : +106/-4 in 3 file(s)
URL    : https://src.fedoraproject.org/rpms/perl-XML-Bare/c/2d11b959912b005342aa14b3f4900c5e3b8e6677?branch=f44

Log:
Include two security fixes for XML-Bare =< 0.53

---
diff --git a/CVE-2026-13401-r1.patch b/CVE-2026-13401-r1.patch
new file mode 100644
index 0000000..f478a50
--- /dev/null
+++ b/CVE-2026-13401-r1.patch
@@ -0,0 +1,26 @@
+From: CPANSec Security Scanner Bot <cpan-security@security.metacpan.org>
+Subject: [PATCH] XML::Bare: advance stuck attribute-name state (infinite loop)
+
+Infinite loop (CWE-835) in the hand-rolled C parser (parser.c), reached
+by the default XML::Bare->new(text=>$xml)->parse on untrusted XML.
+
+The `att_nameqsdone` state — reached after a single-quoted attribute
+*name* — loops back to itself without advancing `cpos` on any character
+other than `=` or NUL, spinning forever in C on malformed input. The
+parser holds the interpreter for the duration of the call, so no
+Perl-level signal (`alarm`, etc.) can interrupt it: a single request
+pins a CPU indefinitely. Triggers: `<a ='c'>`, `<a b='''''''c'>`,
+`<x y=''''''z'>`.
+
+Fix: advance the cursor before looping, so the scan terminates at the
+next `=` or at the NUL sentinel (already handled by the `case 0` branch).
+--- a/parser.c
++++ b/parser.c
+@@ -484,6 +485,7 @@
+           cpos++;
+           goto att_eq1;
+       }
++      cpos++; // advance the cursor so malformed input (no '=' after a quoted attr name) cannot spin forever
+       goto att_nameqsdone;
+       
+     att_eq1:

diff --git a/CVE-2026-57074-r1.patch b/CVE-2026-57074-r1.patch
new file mode 100644
index 0000000..29e382c
--- /dev/null
+++ b/CVE-2026-57074-r1.patch
@@ -0,0 +1,65 @@
+From: CPANSec Security Scanner Bot <cpan-security@security.metacpan.org>
+Subject: [PATCH] XML::Bare: bounds truncated fixed-advance lookahead (heap OOB read)
+
+Heap-buffer-overflow READ (CWE-125) in the hand-rolled C parser
+(parser.c), reached by the default XML::Bare->new(text=>$xml)->parse on
+untrusted XML.
+
+Several transitions advance `cpos` by a fixed amount past a recognised
+token without checking the buffer end, then dereference the new position:
+
+  - the `<![CDATA` match does `cpos += 9` after confirming only eight
+    bytes (`<![CDATA`), so a truncated tail such as `<![CDATA\0` steps
+    one byte past the NUL terminator;
+  - the three "self-closing tag" branches (name_x, name_gap, att_name)
+    do `cpos += 2` on the assumption that a `>` follows the `/`, so a
+    truncated tail such as `<a/\0` steps past the NUL.
+
+The subsequent `let = *cpos;` in val_1/val_x/cdata then reads out of
+bounds. Trigger: `<!-- c --><a/`.
+
+Fix: require the full `<![CDATA[` (nine bytes) before the `+= 9`, and
+only skip the assumed `>` when `*(cpos+1)` is non-NUL. Both changes are
+behaviour-preserving for well-formed input — real CDATA always carries
+the `[`, and a non-truncated self-close always has a byte after the `/`;
+they differ only on the truncated-tail case that previously overran the
+allocation.
+--- a/parser.c
++++ b/parser.c
+@@ -193,7 +193,8 @@
+                     *(cpos+4) == 'D' &&
+                     *(cpos+5) == 'A' &&
+                     *(cpos+6) == 'T' &&
+-                    *(cpos+7) == 'A'    ) {
++                    *(cpos+7) == 'A' &&
++                    *(cpos+8) == '['    ) { // require full "<![CDATA[" so cpos+=9 cannot skip past a truncated tail
+                   cpos += 9;
+                   curnode->type = 1;
+                   goto cdata;
+@@ -344,7 +345,7 @@
+           temp = nodec_addchildr( curnode, tagname, tagname_len );
+           temp->z = cpos +1 - xmlin;
+           tagname_len            = 0;
+-          cpos+=2;
++          if( *(cpos+1) ) cpos += 2; else cpos++; // skip assumed '>' only if not the NUL terminator
+           goto val_1;
+       }
+       
+@@ -368,7 +369,7 @@
+           curnode->z = cpos+1-xmlin;
+           curnode = curnode->parent;
+           if( !curnode ) goto done;
+-          cpos+=2; // am assuming next char is >
++          if( *(cpos+1) ) cpos += 2; else cpos++; // was: assume next char is > (skip past NUL on truncated tail)
+           goto val_1;
+         case '=':
+           cpos++;
+@@ -425,7 +426,7 @@
+           curnode->z = cpos+1-xmlin;
+           curnode = curnode->parent;
+           if( !curnode ) goto done;
+-          cpos += 2;
++          if( *(cpos+1) ) cpos += 2; else cpos++; // "/> assumed" — skip '>' only if present, not the NUL
+           goto val_1;
+         case ' ':
+           if( *(cpos+1) == '=' ) {

diff --git a/perl-XML-Bare.spec b/perl-XML-Bare.spec
index 2389192..35a0f89 100644
--- a/perl-XML-Bare.spec
+++ b/perl-XML-Bare.spec
@@ -1,12 +1,20 @@
 Name:           perl-XML-Bare
 Version:        0.53
-Release:        44%{?dist}
+Release:        45%{?dist}
 Summary:        Minimal XML parser implemented via a C state engine
 License:        GPL-1.0-or-later OR Artistic-1.0-Perl
-URL:            https://metacpan.org/release/XML-Bare
+URL:            https://metacpan.org/dist/XML-Bare
 Source0:        https://cpan.metacpan.org/authors/id/C/CO/CODECHILD/XML-Bare-%{version}.tar.gz
+# https://rt.cpan.org/Ticket/Display.html?id=145653
 Patch0:         perl-XML-Bare-c99.patch
-Patch1: perl-XML-Bare-c99-2.patch
+# https://rt.cpan.org/Public/Bug/Display.html?id=151041
+Patch1:         perl-XML-Bare-c99-2.patch
+# https://github.com/nanoscopic/perl-XML-Bare/pull/1
+# https://security.metacpan.org/patches/X/XML-Bare/0.53/CVE-2026-57074-r1.patch
+Patch2:         CVE-2026-57074-r1.patch
+# https://github.com/nanoscopic/perl-XML-Bare/pull/2
+# https://security.metacpan.org/patches/X/XML-Bare/0.53/CVE-2026-13401-r1.patch
+Patch3:         CVE-2026-13401-r1.patch
 BuildRequires:  gcc
 BuildRequires:  make
 BuildRequires:  perl-devel
@@ -49,11 +57,14 @@ chmod 644 Bare.pm
 
 %files
 %doc Changes README
-%{perl_vendorarch}/auto/*
+%{perl_vendorarch}/auto/XML*
 %{perl_vendorarch}/XML*
 %{_mandir}/man3/XML*
 
 %changelog
+* Sun Aug 30 2026 Emmanuel Seyman <emmanuel@seyman.fr> - 0.53-47
+- Include two security fixes for XML-Bare =< 0.53
+
 * Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.53-44
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
 

                 reply	other threads:[~2026-08-30  9:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=178808160000.1.9878284496376625908.rpms-perl-XML-Bare-2d11b959912b@fedoraproject.org \
    --to=emmanuel@seyman.fr \
    --cc=git-commits@fedoraproject.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