1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
https://bugs.gentoo.org/980109
https://security.metacpan.org/patches/D/Date-Manip/6.99/CVE-2026-60075-r1.patch
From: CPANSec Security Scanner Bot <cpan-security@security.metacpan.org>
--- a/lib/Date/Manip/Date.pm
+++ b/lib/Date/Manip/Date.pm
@@ -94,6 +94,13 @@ sub input {
# DATE PARSING
########################################################################
+# The longest string the parsers will look at. The time matching
+# regexp is applied unanchored, so the cost of failing to match grows
+# with the square of the length of an interior whitespace run. Real
+# date strings are well under 100 characters.
+
+our $MAXLENGTH = 256;
+
sub parse {
my($self,$instring,@opts) = @_;
$self->_init();
@@ -104,6 +111,11 @@ sub parse {
return 1;
}
+ if (length($instring) > $MAXLENGTH) {
+ $$self{'err'} = '[parse] Date string too long';
+ return 1;
+ }
+
my %opts = map { $_,1 } @opts;
my $dmt = $$self{'tz'};
@@ -382,6 +394,11 @@ sub parse_time {
return 1;
}
+ if (length($string) > $MAXLENGTH) {
+ $$self{'err'} = '[parse_time] Time string too long';
+ return 1;
+ }
+
my($y,$m,$d,$h,$mn,$s);
if ($$self{'err'}) {
|