php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48786 PCRE crashes Apache connection using xampp
Submitted: 2009-07-03 11:03 UTC Modified: 2009-07-03 11:14 UTC
From: David dot Gausmann at measx dot com Assigned:
Status: Not a bug Package: PCRE related
PHP Version: 6CVS-2009-07-03 (CVS) OS: Windows XP SP3
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: David dot Gausmann at measx dot com
New email:
PHP Version: OS:

 

 [2009-07-03 11:03 UTC] David dot Gausmann at measx dot com
Description:
------------
Hello,

this Bugs seems to be similiar to http://bugs.php.net/bug.php?id=38512

My php version is 5.2.9 (because the current xampp version seems not to include a newer one).
I've tried to replace the php files in the xampp installation, but it results in a crash.
Please don't be angry that I've chosen a wrong php version here.

I'm using PCRE to evaluate VBS source codes.
To do this I use the current xampp version (1.7.1 / win32).

During the evaluation process I've modified a regular expression.
After that my browser told me "the server has reset the connection".

As you can see the string (which shall be evaluated) is very long.

I found out that error depends on three things:
1. The length of the evaluation string
2. The |"" in the pattern (which is wrong for VBS evaluation, but it was a
test)
3. The "\'" in the evaluation string

If the pattern whould be wrong then only a php error should occur.

An other interesting fact is that the php script works fine if I execute the
script with the php.exe directly.
Hence the error depends on the combination apache - php - pcre

I've already reported this bug to PCRE, but they said I should report it here.

Kind Regards
David Gausmann (Bananen-Joe)

Reproduce code:
---------------
$sContent = 'Call ABCDEFGHJIKLMNOPQRSTUVWXYZ("Lorem Ipsum dolor sit amet,
consectetuer elitr\'" & VARIABLE & "\'" & vbCRLF &                             
               vbCRLF &                                             "Lorem
ipsum dolor sit amet conset" & vbCRLF &                                        
    vbCRLF &                                             "Lorem ipsum dolor sit
amet consectetuer sadipscing.")';
echo preg_match('/^(?:[^"]|"(?:[^"]|"")*")*(?:var_alloc)\s*\(?\s*"[^"]+".*$/i',
$sContent);

Expected result:
----------------
preg_match should return 0 (no match)

Actual result:
--------------
The apache aborts the connection

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-03 11:14 UTC] pajoye@php.net
duplicate #47689
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 12:01:27 2024 UTC