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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-03 11:14 UTC] pajoye@php.net
duplicate #47689
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jan 15 10:01:29 2025 UTC