Please Update PCRE Library ( unsafe vulnerabilities )

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Tristano
Enthusiast
Enthusiast
Posts: 190
Joined: Thu Nov 26, 2015 6:52 pm
Location: Italy
Contact:

Please Update PCRE Library ( unsafe vulnerabilities )

Post by Tristano »

As of PB 5.71 LTS, the current version of PCRE used for the Regular Expressions library is PCRE v8.30 (2012-02-04), which is known to contain serious security vulnerabilities.

[ EDIT 2020/02/27Issue fixed: viewtopic.php?f=4&t=74685 ]

PRCE info obtained by running:

Code: Select all

ImportC ""
  pb_pcre_version(void);
EndImport

regex = CreateRegularExpression(#PB_Any, "")
pcre_version = pb_pcre_version(0)
Debug PeekS(pcre_version, -1, #PB_Ascii)
A serious vulnerability as been found in PCRE version 8.37 and prior, which could allow for the execution of arbitrary code, as reported by the Center for Internet Security (CIS):
A vulnerability has been discovered in the PCRE Library, which could allow for arbitrary code execution. This vulnerability occurs because the library fails to perform adequate boundary-checks on user-supplied data. When the library writes to the compile_regex function, it writes more than the allocated block size causing a heap buffer overflow.

Successful exploitation of this vulnerability through a specially crafted or vulnerable expression could trigger this issue, resulting in the execution of arbitrary code, in the context of the user running the application, with failed attempts triggering denial-of-service conditions.
These security issues have been know for years, and the PCRE library has been fixed accordingly in 2015 (PCRE 8.37), but PureBasic is still using PCRE v8.30, which dates back to 2012. Since the RegEx library is one of the frequently used PB components, I hope that it will be updated soon. Personally, I'd feel uncomfortable distributing applications using the RegEx library knowing of this security issue, and even more so if the application is being created for a paying client. Besides, these security issues have been known for years, so there are really no justifications for keeping using such an old version of PCRE.

The current PCRE library is lagging well behind the official upstream PCRE, which is currently at version 8.43 (2019-02-23), so a security update might also be a good occasion to benefit from new features and the many bug fixes since 2012.

https://www.pcre.org/original/changelog.txt
Last edited by Tristano on Thu Feb 27, 2020 2:29 am, edited 1 time in total.
The PureBASIC Archives: FOSS Resources:
Little John
Addict
Addict
Posts: 4527
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by Little John »

Ooops! :shock:
+ 10 from me.
User avatar
StarBootics
Addict
Addict
Posts: 984
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by StarBootics »

Little John wrote:Ooops! :shock:
+ 10 from me.
Indeed.
The Stone Age did not end due to a shortage of stones !
davido
Addict
Addict
Posts: 1890
Joined: Fri Nov 09, 2012 11:04 pm
Location: Uttoxeter, UK

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by davido »

+1
DE AA EB
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by Sicro »

+1
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
IdeasVacuum
Always Here
Always Here
Posts: 6425
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by IdeasVacuum »

+1
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by Mijikai »

+1
User avatar
NicTheQuick
Addict
Addict
Posts: 1226
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by NicTheQuick »

+1
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
marcoagpinto
Addict
Addict
Posts: 947
Joined: Sun Mar 10, 2013 3:01 pm
Location: Portugal
Contact:

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by marcoagpinto »

+1
User avatar
Sicro
Enthusiast
Enthusiast
Posts: 538
Joined: Wed Jun 25, 2014 5:25 pm
Location: Germany
Contact:

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by Sicro »

Will apparently be done in the next PB version:
Image
Why OpenSource should have a license :: PB-CodeArchiv-Rebirth :: Pleasant-Dark (syntax color scheme) :: RegEx-Engine (compiles RegExes to NFA/DFA)
Manjaro Xfce x64 (Main system) :: Windows 10 Home (VirtualBox) :: Newest PureBasic version
Little John
Addict
Addict
Posts: 4527
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Please Update PCRE Library ( unsafe vulnerabilities )

Post by Little John »

Image
Post Reply