[wp-trac] [WordPress Trac] #35979: Specific URL text present in post or page contents may cause WP to run out of memory in the front-end

WordPress Trac noreply at wordpress.org
Sat Feb 27 20:10:25 UTC 2016


#35979: Specific URL text present in post or page contents may cause WP to run out
of memory in the front-end
--------------------------+-----------------------------
 Reporter:  fhoech        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Embeds        |    Version:  4.4.2
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 When the following URL text (no HTML, I added code tags only to prevent
 Trac from displaying the URL as HTML link) is present in the contents of a
 WordPress post or page, WordPress may run out of memory when trying to
 view the post or page in the front-end, depending on the PHP memory limit.

 {{{
 http://www.homecinema-fr.com/colorimetre/release/DVD_V2.0.0.ISO
 }}}


 This URL points to an ISO disc image with a size of 63846400 bytes.
 When this URL text is present in the contents of a post or page, e.g. with
 a WordPress install on a shared web host with limited memory, this can
 lead to an out of memory error like the following (the error is normally
 swallowed in the front-end, so unfortunately in the front-end the page
 just ends where the URL would be, but logging into the web host via SSH
 and running PHP from the command line allowed me to grab the error):

 {{{
 Fatal error: Allowed memory size of 125829120 bytes exhausted (tried to
 allocate 63846401 bytes) in wp-includes/class-oembed.php on line 345
 }}}

 As evidenced by the error message above, PHP tries to allocate 63846401
 bytes, which is exactly the size of the ISO disc image + 1 byte, which
 leads me to believe WP actually tries to fetch the resource (or at least
 tries to allocate enough memory so it could fit the resource).

 Example WordPress install exhibiting the problem:
 http://wp.hoech.net/

 The document ends after <div class="entry-content">, where normally the
 URL text would appear.

 This probably affects WordPress from 4.4 (inclusive) onwards.

 A way to work-around the problem is to install the "Disable Embeds" plug-
 in (https://wordpress.org/plugins/disable-embeds/).

 Steps to reproduce:
 1. Have a PHP memory limit of 125829120 bytes or below.
 2. Have a clean WordPress 4.4.2 install (no plugins, default theme).
 3. Create a new page.
 4. Switch the editor to "text" mode.
 5. Paste the following URL into the editor:
 {{{
 http://www.homecinema-fr.com/colorimetre/release/DVD_V2.0.0.ISO
 }}}
 6. Publish the page.
 7. Try to view the page in the front-end.

 Result:
 The HTML document ends where the post contents should be (i.e. after <div
 class="entry-content"> when viewing page source).

 Expected result:
 The page should render completely.

--
Ticket URL: <https://core.trac.wordpress.org/ticket/35979>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list