现在是另一个补丁发布日了,Magento 1.x的SUPEE-7405已经发布,修复列表很长:https ://magento.com/security/patches/supee-7405
在获得最后一个补丁的经验之后,我不得不再次问:应用补丁时可能会出现什么问题,我需要考虑什么?
许多XSS问题再次得到修复,因此我希望手动修补自定义主题。还要别的吗?是否存在向后不兼容的更改?
现在是另一个补丁发布日了,Magento 1.x的SUPEE-7405已经发布,修复列表很长:https ://magento.com/security/patches/supee-7405
在获得最后一个补丁的经验之后,我不得不再次问:应用补丁时可能会出现什么问题,我需要考虑什么?
许多XSS问题再次得到修复,因此我希望手动修补自定义主题。还要别的吗?是否存在向后不兼容的更改?
Answers:
2016年2月23日更新:补丁程序已更新至V1.1,它修复了本文中列出的许多重要问题,以下是列表:
深入研究补丁之后,这里是我发现的相关/有趣的东西(注意:此列表是通过分析CE 1.9.2.0-1.9.2.2的补丁制作而成的,可能会影响旧版本的Magento的补丁更多) :
[]
代替代替array()
使其向后与PHP <5.4不兼容(请参见下面的已知问题)Mage_Admin_Model_Observer
Mage_Adminhtml_IndexController
Mage_Adminhtml_IndexController
getDeleteUrl
的Mage_Checkout_Block_Cart_Item_Renderer
,并在确认deleteAction
的Mage_Checkout_CartController
。controller_action_postdispatch_checkout_onepage_saveOrder
变为controller_action_postdispatch_checkout_onepage_saveorder
)。这不会影响您的本地观察者配置。此处更多信息:https : //twitter.com/foomanNZ/status/689924329065164800Mage_Core_Model_File_Validator_Image
System => Configuration =>Advanced > System => Escape CSV Fields
admin_user_validate
在Mage_Admin_Model_User
Mage_Authorizenet_Helper_Admin
用于获取成功订单网址的新管理员帮助()。Zend_Xml_Security
。其目的是扫描XML字符串以发现潜在的XXE和XEE攻击。但是,在其他修改后的文件中我找不到任何引用。修补后的已知问题:
我将尽力使此列表保持最新。
在开始一个新的问题之前,请确保您已经应用了所有以前的补丁,因为看来很多问题都来自缺少补丁。
另一件事是:如果您修改了核心文件,则应用修补程序可能会失败。如果Hunk # failed at
特定文件有错误,并且100%确定已应用所有以前的补丁程序,请通过检查镜像确保您拥有Magento版本的原始文件:https : //github.com / OpenMage / magento-mirror /
/index.php/api/v2_soap/index/?wsdl=1
引发500错误 =>我为此开发了一个hacky修复程序,可以在这里找到:https : //magento.stackexchange.com/a/98790/2380 /我还创建了一个错误报告这个:https ://www.magentocommerce.com/bug-tracking/issue/index/id/1265(来源:@ Moonman67)app/code/core/Mage/Core/Model/Config.php
(仅适用于EE):SUPEE 7405 Enterprise Edition致命错误未定义的类常量'AREA_ADMINHTMLMage_Core_Helper_Abstract::escapeHtml()
1.4.0.1 上的未定义方法 :在Magento 1.4.0.1上安装补丁7405后出错_singleton/Mage_Core_Model_Domainpolicy
Mageto 1.7上已存在Mage注册表项:安全修补程序SUPEE-7405错误受影响的文件列表
可以在此页面上的此处找到:https ://magento.stackexchange.com/a/98232/2380(版权@MagenX)
仅EE
关于7616补丁:
关于Magento补丁的良好资源
如果我错过了什么,请随时告诉我。
我注意到的一个问题是,如果您的站点使用的版本低于PHP 5.4,则该修补程序不兼容。
在第Mage_Adminhtml_Helper_Sales
124行左右的类中。代码为:
$links = [];
我需要扩展为:
// Patch not compatible with PHP version 5.3: overwrote Magento patch update
$links = array();
我遇到的另一个错误似乎与我设置的Cookie有关。不过,一旦我清除了cookie,所有页面都可以正常加载了。
错误示例:
Notice: unserialize() [function.unserialize]: Error at offset 0 of 13 bytes in `/var/www/website/app/code/core/Mage/Core/Helper/Cookie.php` on line 83
我不确定是否有人遇到过这些问题,但希望对您有所帮助!
这是在用SUPEE-7405修补Magento CE时发现的一个问题。它代替了这一行:
chmod($destinationFile, 0777);
与:
chmod($destinationFile, 0640);
在文件中 lib/Varien/File/Uploader.php
由于该文件权限实际上应该为644,所以这停止了我的图像在后端显示。是否有任何理由将其设置为640?
chown USERNAME:nobody -R public_html
find ./public_html -type d -exec chmod g+s {} \;
申请Magento 1.7.0.0时,其尝试删除对的评论 app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml
-/* @var $_helper Mage_Authorizenet_Helper_Data */
1.7.0.0- https: //raw.githubusercontent.com/OpenMage/magento-mirror/1.7.0.0/app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml
直到1.7.0.1 https://raw.githubusercontent.com/OpenMage/magento-mirror/1.7.0.1/app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml才添加
这些文件已打补丁,您可以看到任何可能的影响:
模板:主要是打补丁的管理模板。
+++ app/design/frontend/base/default/template/rss/order/details.phtml
+++ app/design/frontend/base/default/template/catalog/product/view/options/type/file.phtml
+++ app/design/adminhtml/default/default/template/sales/order/view/info.phtml
+++ app/design/adminhtml/default/default/template/sales/order/totals/discount.phtml
+++ app/design/adminhtml/default/default/template/sales/items/renderer/default.phtml
+++ app/design/adminhtml/default/default/template/sales/items/column/name.phtml
+++ app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/name.phtml
+++ app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/invoice/name.phtml
+++ app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/creditmemo/name.phtml
+++ app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml
+++ app/design/adminhtml/default/default/template/bundle/sales/shipment/view/items/renderer.phtml
+++ app/design/adminhtml/default/default/template/bundle/sales/shipment/create/items/renderer.phtml
+++ app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml
+++ app/design/adminhtml/default/default/template/bundle/sales/invoice/view/items/renderer.phtml
+++ app/design/adminhtml/default/default/template/bundle/sales/invoice/create/items/renderer.phtml
+++ app/design/adminhtml/default/default/template/bundle/sales/creditmemo/view/items/renderer.phtml
+++ app/design/adminhtml/default/default/template/bundle/sales/creditmemo/create/items/renderer.phtml
+++ app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml
核心/库:
+++ lib/Varien/Io/File.php
+++ lib/Varien/File/Uploader.php
+++ app/code/core/Zend/Xml/Security.php
+++ app/code/core/Mage/Sales/Model/Quote/Item.php
+++ app/code/core/Mage/Sales/Model/Quote/Address.php
+++ app/code/core/Mage/Sales/Helper/Guest.php
+++ app/code/core/Mage/Rss/Helper/Order.php
+++ app/code/core/Mage/Rss/Block/Catalog/Salesrule.php
+++ app/code/core/Mage/Review/controllers/ProductController.php
+++ app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php
+++ app/code/core/Mage/Paypal/controllers/PayflowController.php
+++ app/code/core/Mage/Newsletter/Model/Queue.php
+++ app/code/core/Mage/Newsletter/Model/Observer.php
+++ app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
+++ app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php
+++ app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php
+++ app/code/core/Mage/Downloadable/controllers/CustomerController.php
+++ app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php
+++ app/code/core/Mage/Customer/controllers/AccountController.php
+++ app/code/core/Mage/Core/Model/Session.php
+++ app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php
+++ app/code/core/Mage/Core/Model/File/Validator/Image.php
+++ app/code/core/Mage/Core/Model/Email/Template/Filter.php
+++ app/code/core/Mage/Core/Model/Email/Queue.php
+++ app/code/core/Mage/Core/Model/Config.php
+++ app/code/core/Mage/Core/Model/App.php
+++ app/code/core/Mage/Core/Helper/Data.php
+++ app/code/core/Mage/Checkout/controllers/OnepageController.php
+++ app/code/core/Mage/Checkout/controllers/CartController.php
+++ app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php
+++ app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php
+++ app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php
+++ app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php
+++ app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php
+++ app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php
+++ app/code/core/Mage/Authorizenet/Helper/Data.php
+++ app/code/core/Mage/Authorizenet/Helper/Admin.php
+++ app/code/core/Mage/Adminhtml/controllers/IndexController.php
+++ app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php
+++ app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php
+++ app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php
+++ app/code/core/Mage/Adminhtml/Helper/Sales.php
+++ app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php
+++ app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
+++ app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php
+++ app/code/core/Mage/Admin/Model/User.php
+++ app/code/core/Mage/Admin/Model/Resource/User.php
+++ app/code/core/Mage/Admin/Model/Redirectpolicy.php
+++ app/code/core/Mage/Admin/Model/Observer.php
================================================== ======================= PS 只是把所有在一起,我们创造了一些“没有脑子”多面体修补与多个Magento的安装多台服务器。 multipatch-7405.sh
这是我的基本测试计划:
请注意Colin Mollenhour最近发现并修复(?)的会话丢失问题 。
https://gist.github.com/colinmollenhour/5066a3220881881a9c0c2dd42fa1593cbff/revisions
如果您从Magento EE 1.14.2.x更新到Magento EE 1.14.2.3而不是应用补丁,并且之前也应用了支持补丁SUPEE-5984,则必须重新应用它,因为它不包含在发行版中。
这是修复了损坏的索引器的补丁:升级到EE 1.14.2.0后的索引错误:表catalog_product_entity_tmp_indexer不存在
截至2016年2月23日,Magento已针对该补丁发布了一个补丁,以解决许多此类问题:https : //magento.com/security/patches/supee-7405
您需要依次应用SUPEE_7405_v1和SUPEE_7405_v1.1。
每当我们为其中一个客户安装补丁程序时,我们都会使用以下清单:
app/etc/applied.patches.list
文件中看到)我想这就是全部。这些修补程序旨在快速安装且没有任何麻烦。10次中有9次可以很好地安装,而其他时候我们有备份。只要您不弄乱核心文件,一切都应该没问题。
app/etc/applied.patches.list
这里是Magento EE的受影响文件
> -e 2016-02-11 03:14:54 UTC | SUPEE-7405-EE-1-14-2-2 | EE_1.14.2.2 | v1 | 91465c744a824111902e2911fd63fd8cb6c32f05 | Tue Jan 19 14:27:03 2016 +0200 | e1fc3c59c9..91465c744a
patching file app/code/core/Enterprise/Checkout/Block/Adminhtml/Manage/Form/Coupon.php
patching file app/code/core/Enterprise/GoogleAnalyticsUniversal/Block/Ga.php
patching file app/code/core/Enterprise/PageCache/etc/config.xml
patching file app/code/core/Enterprise/Pbridge/etc/config.xml
patching file app/code/core/Enterprise/Pci/Model/Observer.php
patching file app/code/core/Enterprise/Pci/Model/Resource/Admin/User.php
patching file app/code/core/Enterprise/Pci/etc/config.xml
patching file app/code/core/Enterprise/Persistent/etc/config.xml
patching file app/code/core/Enterprise/SalesArchive/etc/config.xml
patching file app/code/core/Enterprise/WebsiteRestriction/etc/config.xml
patching file app/code/core/Mage/Admin/Model/Observer.php
patching file app/code/core/Mage/Admin/Model/Redirectpolicy.php
patching file app/code/core/Mage/Admin/Model/Resource/User.php
patching file app/code/core/Mage/Admin/Model/User.php
patching file app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php
patching file app/code/core/Mage/Adminhtml/Block/Widget/Grid.php
patching file app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Edit/Action/Attribute.php
patching file app/code/core/Mage/Adminhtml/Helper/Sales.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/File.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image.php
patching file app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Image/Favicon.php
patching file app/code/core/Mage/Adminhtml/controllers/IndexController.php
patching file app/code/core/Mage/Authorizenet/Helper/Admin.php
patching file app/code/core/Mage/Authorizenet/Helper/Data.php
patching file app/code/core/Mage/Authorizenet/controllers/Adminhtml/Authorizenet/Directpost/PaymentController.php
patching file app/code/core/Mage/Captcha/etc/config.xml
patching file app/code/core/Mage/Catalog/Block/Product/View/Options/Type/Select.php
patching file app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Image.php
patching file app/code/core/Mage/Catalog/Model/Resource/Product/Attribute/Backend/Image.php
patching file app/code/core/Mage/CatalogIndex/etc/config.xml
patching file app/code/core/Mage/CatalogInventory/Helper/Minsaleqty.php
patching file app/code/core/Mage/Checkout/Block/Cart/Item/Renderer.php
patching file app/code/core/Mage/Checkout/controllers/CartController.php
patching file app/code/core/Mage/Checkout/controllers/OnepageController.php
patching file app/code/core/Mage/Core/Helper/Data.php
patching file app/code/core/Mage/Core/Model/App.php
patching file app/code/core/Mage/Core/Model/Config.php
patching file app/code/core/Mage/Core/Model/Email/Queue.php
patching file app/code/core/Mage/Core/Model/Email/Template/Filter.php
patching file app/code/core/Mage/Core/Model/File/Validator/Image.php
patching file app/code/core/Mage/Core/Model/Input/Filter/MaliciousCode.php
patching file app/code/core/Mage/Core/Model/Session.php
patching file app/code/core/Mage/Customer/controllers/AccountController.php
patching file app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php
patching file app/code/core/Mage/Downloadable/controllers/CustomerController.php
patching file app/code/core/Mage/ImportExport/Model/Export/Adapter/Abstract.php
patching file app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php
patching file app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php
patching file app/code/core/Mage/ImportExport/etc/config.xml
patching file app/code/core/Mage/ImportExport/etc/system.xml
patching file app/code/core/Mage/Newsletter/Model/Observer.php
patching file app/code/core/Mage/Newsletter/Model/Queue.php
patching file app/code/core/Mage/Page/etc/system.xml
patching file app/code/core/Mage/Paypal/controllers/PayflowController.php
patching file app/code/core/Mage/Paypal/controllers/PayflowadvancedController.php
patching file app/code/core/Mage/Paypal/etc/config.xml
patching file app/code/core/Mage/Persistent/etc/config.xml
patching file app/code/core/Mage/Review/controllers/ProductController.php
patching file app/code/core/Mage/Rss/Block/Catalog/Salesrule.php
patching file app/code/core/Mage/Rss/Helper/Order.php
patching file app/code/core/Mage/Sales/Helper/Guest.php
patching file app/code/core/Mage/Sales/Model/Quote/Address.php
patching file app/code/core/Mage/Sales/Model/Quote/Item.php
patching file app/code/core/Zend/Xml/Security.php
patching file app/design/adminhtml/default/default/template/authorizenet/directpost/iframe.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/creditmemo/create/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/creditmemo/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/invoice/create/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/invoice/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/order/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/shipment/create/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/bundle/sales/shipment/view/items/renderer.phtml
patching file app/design/adminhtml/default/default/template/catalog/product/composite/fieldset/options/type/file.phtml
patching file app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/creditmemo/name.phtml
patching file app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/invoice/name.phtml
patching file app/design/adminhtml/default/default/template/downloadable/sales/items/column/downloadable/name.phtml
patching file app/design/adminhtml/default/default/template/enterprise/checkout/form/coupon.phtml
patching file app/design/adminhtml/default/default/template/sales/items/column/name.phtml
patching file app/design/adminhtml/default/default/template/sales/items/renderer/default.phtml
patching file app/design/adminhtml/default/default/template/sales/order/totals/discount.phtml
patching file app/design/adminhtml/default/default/template/sales/order/view/info.phtml
patching file app/design/frontend/base/default/template/catalog/product/view/options/type/file.phtml
patching file app/design/frontend/base/default/template/rss/order/details.phtml
patching file lib/Varien/File/Uploader.php
patching file lib/Varien/Io/File.php
在Magento 1.14.1.0上应用SUPEE-7405后,出现错误:
Fatal error: Cannot redeclare Mage_Core_Controller_Varien_Router_Admin::_validateControllerInstance() in app/code/core/Mage/Core/Controller/Varien/Router/Admin.php on line 173
该问题是由以下方法中重新声明的_validateControllerInstance引起的:
app/code/core/Mage/Core/Controller/Varien/Router/Admin.php on line 173
删除第二(相同)个函数声明后,此问题已解决。
尝试登录到管理员后,在安装SUPEE-7405修补程序后出现以下错误。
致命错误:
在第135行的\ app \ code \ core \ Mage \ Admin \ Model \ Session.php中调用未定义的方法Mage_Core_Controller_Response_Http :: sendHeadersAndExit()
因为我在没有sendHeadersAndExit
此补丁程序创建的方法的本地代码池中覆盖了此文件
。
\app\code\local\Mage\Core\Controller\Response\Http.php
以下方法不存在。(这是添加到核心文件中的新方法)
/**
* Method send already collected headers and exit from script
*/
public function sendHeadersAndExit()
{
$this->sendHeaders();
exit;
}
将其添加到覆盖文件后,问题就消失了。
使用SUPEE-7405时遇到的问题之一是图像上传错误
因此,我检查此文件中的更改: lib / Varien / File / Uploader.php
diff --git lib / Varien / File / Uploader.php lib / Varien / File / Uploader.php --- --- -chmod($ destinationFile,0777); + chmod($ destinationFile,0640); --- --- -if(!(@ is_dir($ destinationFolder)|| @mkdir($ destinationFolder,0777,true))){ + if(!(@ is_dir($ destinationFolder)|| @mkdir($ destinationFolder,0750,true))){
然后,我发现了两种解决方法:
选项1:
我对文件lib / Varien / File / Uploader.php进行了手动更改,以调整0640/0750权限。
选项2: 因为Magento希望网络服务器拥有站点文件,所以:
http://devdocs.magento.com/guides/m1x/install/installer-privileges_after.html#privs-after
解决该问题的另一种方法是使Web服务器成为文件的所有者
chown -R Web服务器用户名magento / root / path
Web服务器的用户名通常为www-data或apache。