[packages/perl-HTML-StripScripts] Up to 1.06
arekm
arekm at pld-linux.org
Thu Nov 19 11:35:25 CET 2026
commit 44439589f9fc10895a975ea18f1f7c2554d109f1
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Thu Nov 19 00:36:07 2026 +0100
Up to 1.06
Fixes CVE-2023-24038 (Patch0, Debian backport of upstream PR #4).
CVE-2023-24038.patch | 91 ++++++++++++++++++++++++++
HTML-StripScripts-1.05-Fix-typo-in-regex.patch | 12 ----
perl-HTML-StripScripts.spec | 8 +--
3 files changed, 95 insertions(+), 16 deletions(-)
---
diff --git a/perl-HTML-StripScripts.spec b/perl-HTML-StripScripts.spec
index e562f01..bc8e3e8 100644
--- a/perl-HTML-StripScripts.spec
+++ b/perl-HTML-StripScripts.spec
@@ -7,13 +7,13 @@
Summary: HTML::StripScripts - Strip scripting constructs out of HTML
Summary(pl.UTF-8): HTML::StripScripts - wyciągnij konstrukcje skryptowe poza HTML
Name: perl-HTML-StripScripts
-Version: 1.05
-Release: 3
+Version: 1.06
+Release: 1
License: GPL v1+ or Artistic
Group: Development/Languages/Perl
Source0: http://www.cpan.org/modules/by-module/HTML/%{pdir}-%{pnam}-%{version}.tar.gz
-# Source0-md5: e8c51fbfda69efaf94c2937084d2458f
-Patch0: HTML-StripScripts-1.05-Fix-typo-in-regex.patch
+# Source0-md5: 23124893ca6f844cecb73b368af50d57
+Patch0: CVE-2023-24038.patch
URL: http://search.cpan.org/dist/HTML-StripScripts/
BuildRequires: perl-devel >= 1:5.8.0
BuildRequires: rpm-perlprov >= 4.1-13
diff --git a/CVE-2023-24038.patch b/CVE-2023-24038.patch
new file mode 100644
index 0000000..b45bc37
--- /dev/null
+++ b/CVE-2023-24038.patch
@@ -0,0 +1,91 @@
+From: IKEDA Soji <ikeda at conversion.co.jp>
+Date: Thu, 12 Jan 2023 14:57:23 +0900
+Subject: Handler for style attribute is vulnerable to ReDoS
+Origin: https://github.com/clintongormley/perl-html-stripscripts/pull/4/commits/3c50e79986bf95728c741f1bc92b61275c30ff54
+Bug: https://github.com/clintongormley/perl-html-stripscripts/issues/3
+Bug-Debian: https://bugs.debian.org/1029400
+Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2023-24038
+
+---
+ lib/HTML/StripScripts.pm | 64 ++++++++++++++++++++++++++++++----------
+ 1 file changed, 48 insertions(+), 16 deletions(-)
+
+diff --git a/lib/HTML/StripScripts.pm b/lib/HTML/StripScripts.pm
+index 3d79c07b75ad..614946f04ab7 100644
+--- a/lib/HTML/StripScripts.pm
++++ b/lib/HTML/StripScripts.pm
+@@ -1598,23 +1598,55 @@ sub _hss_attval_style {
+ my @clean = ();
+
+ # Split on semicolon, making a reasonable attempt to ignore
+- # semicolons inside doublequotes or singlequotes.
+- while ( $attrval =~ s{^((?:[^;'"]|'[^']*'|"[^"]*")+)}{} ) {
+- my $elt = $1;
+- $attrval =~ s/^;//;
+-
+- if ( $elt =~ m|^\s*([\w\-]+)\s*:\s*(.+?)\s*$|s ) {
+- my ( $key, $val ) = ( lc $1, $2 );
+-
+- my $value_class = $filter->{_hssStyle}{$key};
+- next unless defined $value_class;
+- my $sub = $filter->{_hssAttVal}{$value_class};
+- next unless defined $sub;
+-
+- my $cleanval = &{$sub}( $filter, 'style-psuedo-tag', $key, $val );
+- if ( defined $cleanval ) {
+- push @clean, "$key:$val";
++ # semicolons inside doublequotes, singlequotes or parentheses.
++ my $rule = '';
++ my $paren = 0;
++ pos $attrval = 0;
++ while (
++ $attrval =~ m{
++ \G
++ (?:
++ ( [^;'"()]+ | ' [^']* ' | " [^"]* " )
++ | ( [(] )
++ | ( [)] )
++ | ( [;] )
++ | \z
++ )
++ }cgx
++ ) {
++ if (defined $1) {
++ $rule .= $1;
++ next;
++ } elsif ($2) {
++ $rule .= $2;
++ $paren++;
++ next;
++ } elsif ($3) {
++ $rule .= $3;
++ $paren--;
++ last if $paren < 0; # unbalanced parentheses
++ next;
++ } elsif ($4) {
++ if (0 < $paren) { # allow semicolons within parentheses
++ $rule .= $4;
++ next;
+ }
++ } else {
++ last if $paren != 0; # unbalanced parentheses
++ }
++
++ $rule =~ s/\A\s+//;
++ $rule =~ s/\s+\z//;
++ my ($key, $val) = split /\s*:\s*/, $rule, 2;
++ $rule = '';
++
++ next unless defined $val;
++ $key =~ s/\A([-\w]+)\z/lc $1/e
++ or next;
++ my $sub = $filter->{_hssAttVal}{$filter->{_hssStyle}{$key} || ''}
++ or next;
++ if (defined $sub->($filter, 'style-psuedo-tag', $key, $val)) {
++ push @clean, "$key:$val";
+ }
+ }
+
+--
+2.39.0
+
diff --git a/HTML-StripScripts-1.05-Fix-typo-in-regex.patch b/HTML-StripScripts-1.05-Fix-typo-in-regex.patch
deleted file mode 100644
index a2c4463..0000000
--- a/HTML-StripScripts-1.05-Fix-typo-in-regex.patch
+++ /dev/null
@@ -1,12 +0,0 @@
-diff -up HTML-StripScripts-1.05/StripScripts.pm.orig HTML-StripScripts-1.05/StripScripts.pm
---- HTML-StripScripts-1.05/StripScripts.pm.orig 2015-05-05 09:12:33.495920443 +0200
-+++ HTML-StripScripts-1.05/StripScripts.pm 2015-05-05 09:53:33.099908066 +0200
-@@ -1630,7 +1630,7 @@ size or length.
-
- sub _hss_attval_size {
- $_[3]
-- =~ /^\s*([+-]?\d{1,20}(?:\.\d{1,20)?)\s*((?:\%|\*|ex|px|pc|cm|mm|in|pt|em)?)\s*$/i
-+ =~ /^\s*([+-]?\d{1,20}(?:\.\d{1,20})?)\s*((?:\%|\*|ex|px|pc|cm|mm|in|pt|em)?)\s*$/i
- ? lc "$1$2"
- : undef;
- }
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/perl-HTML-StripScripts.git/commitdiff/44439589f9fc10895a975ea18f1f7c2554d109f1
More information about the pld-cvs-commit
mailing list