Perl 5.8.9 UTF-8 regexec.c input validation

CVSS Meta Temp Score
CVSS is a standardized scoring system to determine possibilities of attacks. The Temp Score considers temporal factors like disclosure, exploit and countermeasures. The unique Meta Score calculates the average score of different sources to provide a normalized scoring system.
Current Exploit Price (≈)
Our analysts are monitoring exploit markets and are in contact with vulnerability brokers. The range indicates the observed or calculated exploit price to be seen on exploit markets. A good indicator to understand the monetary effort required for and the popularity of an attack.
CTI Interest Score
Our Cyber Threat Intelligence team is monitoring different web sites, mailing lists, exploit markets and social media networks. The CTI Interest Score identifies the interest of attackers and the security community for this specific vulnerability in real-time. A high score indicates an elevated risk to be targeted for this vulnerability.
6.7$0-$5k0.00

Summaryinfo

A vulnerability labeled as problematic has been found in Perl 5.8.9. The affected element is an unknown function of the file regexec.c of the component UTF-8 Handler. Executing a manipulation can lead to input validation. This vulnerability is tracked as CVE-2015-8853. The attack can be launched remotely. Moreover, an exploit is present. Applying a patch is advised to resolve this issue.

Detailsinfo

A vulnerability classified as critical was found in Perl 5.8.9 (Programming Language Software). This vulnerability affects an unknown part of the file regexec.c of the component UTF-8 Handler. The manipulation with an unknown input leads to a input validation vulnerability. The CWE definition for the vulnerability is CWE-20. The product receives input or data, but it does not validate or incorrectly validates that the input has the properties that are required to process the data safely and correctly. As an impact it is known to affect availability. CVE summarizes:

The (1) S_reghop3, (2) S_reghop4, and (3) S_reghopmaybe3 functions in regexec.c in Perl before 5.24.0 allow context-dependent attackers to cause a denial of service (infinite loop) via crafted utf-8 data, as demonstrated by "a\x80."

The weakness was disclosed 04/20/2016 by Karl Williamson as Patch #123562 as confirmed mailinglist post (oss-sec). The advisory is shared for download at seclists.org. The public release has been coordinated in cooperation with the vendor. This vulnerability was named CVE-2015-8853 since 04/20/2016. The exploitation appears to be easy. The attack can be initiated remotely. No form of authentication is required for a successful exploitation. Technical details and also a public exploit are known. Responsible for the vulnerability is the following code:

if (UTF8_IS_CONTINUED(*s)) {
   while (s > lim && UTF8_IS_CONTINUATION(*s))
      s--;
(...)
The advisory points out:
The regex engine got into an infinite loop because of the malformation. It is trying to back-up over a sequence of UTF-8 continuation bytes. But the character just before the sequence should be a start byte. If not, there is a malformation. I added a test to croak if that isn't the case so that it doesn't just infinitely loop. I did this also in the similar areas of regexec.c.

A public exploit has been developed by Karl Williamson and been published even before and not after the advisory. It is possible to download the exploit at perl5.git.perl.org. It is declared as proof-of-concept. The vulnerability scanner Nessus provides a plugin with the ID 90956 (Fedora 22 : perl-5.20.3-330.fc22 (2016-5a9313e4b4)), which helps to determine the existence of the flaw in a target environment. It is assigned to the family Fedora Local Security Checks and running in the context l. The commercial vulnerability scanner Qualys is able to test this issue with plugin 296002 (Solaris 11.3 Support Repository Update (SRU) 9.4.0 Missing). The code used by the exploit is:

my $code='
   BEGIN{require q(test.pl);}
   use Encode qw(_utf8_on);
   my $malformed = "a\x80\n";
   _utf8_on($malformed);
   watchdog(3);
   $malformed =~ /(\n\r|\r)$/;
   print q(No infinite loop here!);
';

Applying a patch is able to eliminate this problem. The bugfix is ready for download at perl5.git.perl.org. A possible mitigation has been published even before and not after the disclosure of the vulnerability. The vulnerability will be addressed with the following lines of code:

if (! UTF8_IS_START(*s)) {
   dTHX;
   Perl_croak(aTHX_ "Malformed UTF-8 character (fatal)");
}

The vulnerability is also documented in the databases at X-Force (112536), Tenable (90956) and SecurityFocus (BID 86707†). The entries VDB-74783, VDB-78889, VDB-80607 and VDB-80673 are pretty similar. VulDB is the best source for vulnerability data and more expert information about this specific topic.

Productinfo

Type

Name

Version

License

CPE 2.3info

CPE 2.2info

CVSSv4info

VulDB Vector: 🔍
VulDB Reliability: 🔍

CVSSv3info

VulDB Meta Base Score: 7.5
VulDB Meta Temp Score: 7.1

VulDB Base Score: 7.5
VulDB Temp Score: 6.7
VulDB Vector: 🔍
VulDB Reliability: 🔍

NVD Base Score: 7.5
NVD Vector: 🔍

CVSSv2info

AVACAuCIA
💳💳💳💳💳💳
💳💳💳💳💳💳
💳💳💳💳💳💳
VectorComplexityAuthenticationConfidentialityIntegrityAvailability
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock
UnlockUnlockUnlockUnlockUnlockUnlock

VulDB Base Score: 🔍
VulDB Temp Score: 🔍
VulDB Reliability: 🔍

NVD Base Score: 🔍

Exploitinginfo

Class: Input validation
CWE: CWE-20
CAPEC: 🔍
ATT&CK: 🔍

Physical: No
Local: No
Remote: Yes

Availability: 🔍
Access: Public
Status: Proof-of-Concept
Author: Karl Williamson
Download: 🔍

EPSS Score: 🔍
EPSS Percentile: 🔍

Price Prediction: 🔍
Current Price Estimation: 🔍

0-DayUnlockUnlockUnlockUnlock
TodayUnlockUnlockUnlockUnlock

Nessus ID: 90956
Nessus Name: Fedora 22 : perl-5.20.3-330.fc22 (2016-5a9313e4b4)
Nessus File: 🔍
Nessus Risk: 🔍
Nessus Family: 🔍
Nessus Context: 🔍

OpenVAS ID: 864555
OpenVAS Name: Fedora Update for perl FEDORA-2016-5
OpenVAS File: 🔍
OpenVAS Family: 🔍

Qualys ID: 🔍
Qualys Name: 🔍

Threat Intelligenceinfo

Interest: 🔍
Active Actors: 🔍
Active APT Groups: 🔍

Countermeasuresinfo

Recommended: Patch
Status: 🔍

0-Day Time: 🔍

Patch: perl5.git.perl.org

Timelineinfo

09/16/2015 🔍
09/16/2015 +0 days 🔍
04/20/2016 +217 days 🔍
04/20/2016 +0 days 🔍
04/20/2016 +0 days 🔍
04/25/2016 +5 days 🔍
05/09/2016 +14 days 🔍
05/25/2016 +16 days 🔍
03/22/2019 +1031 days 🔍

Sourcesinfo

Advisory: Patch #123562
Researcher: Karl Williamson
Status: Confirmed
Confirmation: 🔍
Coordinated: 🔍

CVE: CVE-2015-8853 (🔍)
GCVE (CVE): GCVE-0-2015-8853
GCVE (VulDB): GCVE-100-82792
X-Force: 112536 - Perl UTF8 inputs denial of service
SecurityFocus: 86707 - Perl CVE-2015-8853 Denial of Service Vulnerability

scip Labs: https://www.scip.ch/en/?labs.20161013
See also: 🔍

Entryinfo

Created: 04/25/2016 15:33
Updated: 03/22/2019 14:17
Changes: 04/25/2016 15:33 (84), 03/22/2019 14:17 (11)
Complete: 🔍
Cache ID: 216::103

VulDB is the best source for vulnerability data and more expert information about this specific topic.

Discussion

No comments yet. Languages: en.

Please log in to comment.

Do you need the next level of professionalism?

Upgrade your account now!