Zend_View-Migration.xml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!-- Reviewed: no -->
  3. <sect1 id="zend.view.migration">
  4. <title>Migrating from Previous Versions</title>
  5. <para>
  6. This chapter documents primarily backwards compatibility breaks made in
  7. Zend_View, and should serve to aid in migration from previous versions.
  8. </para>
  9. <sect2 id="zend.view.migration.zf5748">
  10. <title>Migrating from versions prior to 1.7.5</title>
  11. <para>
  12. Prior to the 1.7.5 release, the Zend Framework team was notified of
  13. a potential Local File Inclusion (LFI) vulnerability in the
  14. <classname>Zend_View::render()</classname> method. Prior to 1.7.5, the method
  15. allowed, by default, the ability to specify view scripts that
  16. included parent directory notation (e.g., "../" or "..\"). This
  17. opens the possibility for an LFI attack if unfiltered user input is
  18. passed to the <code>render()</code> method:
  19. </para>
  20. <programlisting language="php"><![CDATA[
  21. // Where $_GET['foobar'] = '../../../../etc/passwd'
  22. echo $view->render($_GET['foobar']); // LFI inclusion
  23. ]]></programlisting>
  24. <para>
  25. <classname>Zend_View</classname> now by default raises an exception when such
  26. a view script is requested.
  27. </para>
  28. <sect3 id="zend.view.migration.zf5748.disabling">
  29. <title>Disabling LFI protection for the render() method</title>
  30. <para>
  31. Since a number of developers reported that they were using such
  32. notation within their applications that was <emphasis>not</emphasis>
  33. the result of user input, a special flag was created to allow
  34. disabling the default protection. You have two methods for doing so:
  35. by passing the 'lfiProtectionOn' key to the constructor options, or
  36. by explicitly calling the <code>setLfiProtection()</code> method.
  37. </para>
  38. <programlisting language="php"><![CDATA[
  39. // Disabling via constructor
  40. $view = new Zend_View(array('lfiProtectionOn' => false));
  41. // Disabling via exlicit method call:
  42. $view = new Zend_View();
  43. $view->setLfiProtection(false);
  44. ]]></programlisting>
  45. </sect3>
  46. </sect2>
  47. </sect1>
  48. <!--
  49. vim:se ts=4 sw=4 et:
  50. -->