You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This issue was originally reported to the Perl security team by Sergey Aleynikov as SEC-129. The Perl security team does not consider this issue to represent a vulnerability.
The bug is a 1 byte read overflow in Perl_grok_infnan introduced between 5.28 and 5.30 by the following commit:
f394a63acec59165936868c5a8fa2daef2adb7bf is the first bad commit
commit f394a63acec59165936868c5a8fa2daef2adb7bf
Author: Karl Williamson <[email protected]>
Date: Mon Apr 30 10:39:46 2018 -0600
utf8.c: Use \p{nv=float}
Now that the float data is available to us (in the previous commit), we
can take advantage of it, and avoid swash creation.
We just use the perl atof() to convert the input string to an NV, and
then convert back to a string, but in guaranteed canonical form. Then
we look that up.
The overflow behavior causes no user visible bug. It is only evident when Perl is compiled with address sanitizer.
Steps to Reproduce
$ ./perl -e '0=~/\p{nv:NAnq}/'
=================================================================
==25672==ERROR: AddressSanitizer: heap-buffer-overflow on address 0xf5e01c97 at pc 0x57b92f3a bp 0xffbb9588 sp 0xffbb957c
READ of size 1 at 0xf5e01c97 thread T0
#0 0x57b92f39 in Perl_grok_infnan /home/jd/src/git/lab/perl5/numeric.c:793
#1 0x57b9394f in S_my_atof_infnan /home/jd/src/git/lab/perl5/numeric.c:1429
#2 0x57b9394f in Perl_my_atof3 /home/jd/src/git/lab/perl5/numeric.c:1557
#3 0x5728d839 in Perl_parse_uniprop_string /home/jd/src/git/lab/perl5/regcomp.c:24065
#4 0x572f958a in S_regclass /home/jd/src/git/lab/perl5/regcomp.c:17484
#5 0x5732cd25 in S_regatom /home/jd/src/git/lab/perl5/regcomp.c:13555
#6 0x57359e81 in S_regpiece /home/jd/src/git/lab/perl5/regcomp.c:12421
#7 0x57359e81 in S_regbranch /home/jd/src/git/lab/perl5/regcomp.c:12341
#8 0x57367f71 in S_reg /home/jd/src/git/lab/perl5/regcomp.c:12043
#9 0x5739e3b8 in Perl_re_op_compile /home/jd/src/git/lab/perl5/regcomp.c:7744
#10 0x56f1bf24 in Perl_pmruntime /home/jd/src/git/lab/perl5/op.c:8166
#11 0x5716b1da in Perl_yyparse /home/jd/src/git/lab/perl5/perly.y:1260
#12 0x56f77cb3 in S_parse_body /home/jd/src/git/lab/perl5/perl.c:2601
#13 0x56f7f674 in perl_parse /home/jd/src/git/lab/perl5/perl.c:1892
#14 0x56ce9ebe in main /home/jd/src/git/lab/perl5/perlmain.c:126
#15 0xf7ba7b40 in __libc_start_main (/lib/i386-linux-gnu/libc.so.6+0x1ab40)
#16 0x56ceabf0 in _start (/home/jd/src/git/lab/perl5/perl+0x723bf0)
0xf5e01c97 is located 0 bytes to the right of 7-byte region [0xf5e01c90,0xf5e01c97)
allocated by thread T0 here:
#0 0x56dbc604 in __interceptor_malloc (/home/jd/src/git/lab/perl5/perl+0x7f5604)
#1 0x57421f8d in Perl_safesysmalloc /home/jd/src/git/lab/perl5/util.c:155
Like GH #17367, this was caused by a failure to check that we aren't at
the end of the buffer after advancing the ptr to it.
(cherry picked from commit 9f16475)
Description
This issue was originally reported to the Perl security team by Sergey Aleynikov as SEC-129. The Perl security team does not consider this issue to represent a vulnerability.
The bug is a 1 byte read overflow in Perl_grok_infnan introduced between 5.28 and 5.30 by the following commit:
The overflow behavior causes no user visible bug. It is only evident when Perl is compiled with address sanitizer.
Steps to Reproduce
Perl configuration
The text was updated successfully, but these errors were encountered: