71

On October 27, 2015, Magento has released security patch SUPEE-6788. According to the technical details, 4 APPSEC's that have been fixed require some rework in local and community modules:

  • APPSEC-1034, addressing bypassing custom admin URL (disabled by default)
  • APPSEC-1063, addressing possible SQL injection
  • APPSEC-1057, template processing method allows access to private information
  • APPSEC-1079, addressing potential exploit with custom option file type

I was wondering how to check which modules are affected by this security patch.

I came up with the following partial solution:

  • APPSEC-1034: search for <use>admin</use> in the config.xml of all local and community modules. I think this should list all modules affected by this issue.
  • APPSEC-1063: search for addFieldToFilter('( and addFieldToFilter('` in all PHP files of local and community modules. This is incomplete, as variables can also be used.
  • APPSEC-1057: search for {{config path= and {{block type= in all PHP files of local and community modules, and filter out all elements from the whitelist. This is incomplete, as it does not contain any template variables added by admins, however.
  • APPSEC-1079: no idea.

There is also a list of extensions that are vulnerable for APPSEC-1034 and APPSEC-1063 compiled by Peter Jaap Blaakmeer

16
  • I have no idea how to contact @PeterJaapBlaakmeer but I have an extension that needs added to the list: FreeLunchLabs ConstantContact for the admin url issue Commented Oct 21, 2015 at 16:15
  • 6
    who came up with some of these solutions? Suddenly there's going to be a block type and variable whitelist? Upgrading Magento has always been a pain, but good job to Magento for making it even more of a pain.
    – Agop
    Commented Oct 21, 2015 at 21:45
  • 6
    Heh, Magento, the gift that keeps on giving. I just finished upgrading ALL the modules for 1.9.2.1 compatibility. Bet module developers are just jumping for joy or running screaming for the hills. Commented Oct 22, 2015 at 3:11
  • 3
    at this moment patch postponed for next week - postpone the security patch release until early next week and modify the patch so that the admin routing changes are turned off by default. This means that the patch will include the fix, but that it will be disabled when installed. The new release date and changes to the patch will give you some additional time to make updates to your code and will give merchants flexibility to turn on this part of the patch once their extensions and customizations have been updated to work with it.
    – FireBear
    Commented Oct 22, 2015 at 7:01
  • 1
    PATCH has been released magento.com/security/patches/supee-6788-technical-details
    – Mukesh
    Commented Oct 27, 2015 at 18:07

5 Answers 5

55

SUPEE-6788 released and admin routing changes turned off by default. This means that the patch include the fix, but that it will be disabled when installed. This will give you some additional time to make updates to your code and will give merchants flexibility to turn on this part of the patch once their extensions and customizations have been updated to work with it.

For enable admin routing capability for extensions after install the path go to Admin -> Advanced -> Admin -> Security.

Magento CE 1.4-1.6 patches are delayed and should be available in about one week!

SUPEE-6788 Resources list

6
  • For any "won't fix" modules, can we document what in general needs to be changed so that these modules can be manually patched to work with 6788? For instance, "remove X from all addFieldToFilter calls."
    – Tyler V.
    Commented Oct 23, 2015 at 18:38
  • 1
    The patch has been released. Please update your answer.
    – 7ochem
    Commented Oct 28, 2015 at 9:40
  • @FireBear I have already applied Magento patches in past many times. But I have a doubt about SUPEE-6788. Do I need to apply it like other patches and later I can enable admin routing capability in Magento admin panel or while installation time only I have to take care. Please suggest.
    – Mukesh
    Commented Oct 28, 2015 at 13:11
  • 2
    @Muk yes you can install it as other patches, but need to beware about broken extensions, if you use some extensions form the list - you need to fix them manually or wait for update from developers, until that you can enable - Admin routing capability for extensions
    – FireBear
    Commented Oct 28, 2015 at 13:13
  • @FireBear Could you provide your feedback on community.magento.com/t5/Version-Upgrades/… (Before and After in custom module)
    – Mukesh
    Commented Oct 29, 2015 at 9:44
21

Along the lines of other comments about detecting conflicts, we at ParadoxLabs have created a script to track down everything affected by APPSEC-1034 (admin controllers) and APPSEC-1057 (whitelist). It will also attempt to fix any bad controllers, since that's a fairly precise and invasive change to make.

It doesn't cover APPSEC-1063 (SQL injection) or APPSEC-1079 (custom options), but it would be great if it could. Not sure how to detect those with any sort of precision. We're open to contributions.

https://github.com/rhoerr/supee-6788-toolbox

6
  • 3
    this looks really useful, good work!
    – paj
    Commented Oct 23, 2015 at 15:07
  • fixWhitelists adds blocks to whitelists but doesn't seem to do the same for variables - please could you confirm?
    – zigojacko
    Commented Nov 6, 2015 at 12:08
  • 1
    @zigojacko It covers both.
    – Ryan Hoerr
    Commented Nov 6, 2015 at 13:51
  • Yep, figured this out by giving it a go. Excellent work, super job by ParadoxLabs :)
    – zigojacko
    Commented Nov 9, 2015 at 10:52
  • Respect to ParadoxLabs. That tool is saving a big amount of work.
    – DarkCowboy
    Commented Nov 9, 2015 at 13:28
5

This php script might be useful in identifying Magento code affected by the proposed SUPEE-6788 patch.

This is in no way a foolproof security check for this patch, but might be useful to quickly scan your installation for the modules and code affected.

Install the script with

wget https://raw.githubusercontent.com/gaiterjones/magento-appsec-file-check/master/magento_appsec_file_check.php

edit the path to your Magento installation

$_magentoPath='/home/www/magento/';

run

php magento_appsec_file_check.php

Affected files will be displayed:

*** Magento security file check ***
[1] APPSEC-1034, addressing bypassing custom admin URL
2 effected files :
<use>admin</use> found in  app/code/community/Itabs/Debit/etc/config.xml
<use>admin</use> found in  app/code/core/Mage/Adminhtml/etc/config.xml


[2] APPSEC-1063, addressing possible SQL injection
2 effected files :
collection->addFieldToFilter(' found in  app/code/community/Itabs/Debit/Model/Export/Abstract.php
collection->addFieldToFilter(' found in  app/code/community/Itabs/Debit/controllers/Adminhtml/OrderController.php
collection->addFieldToFilter(' not found.
collection->addFieldToFilter('\` not found.
collection->addFieldToFilter('\` not found.


[3] APPSEC-1057, template processing method allows access to private information
{{config path= not found.
{{block type= not found.


***********************************

The script use grep to search Magento files for occurrences of the code that may possibly break backward compatibility with customizations or extensions when SUPEE-6788 is applied.

4

There is already a big list available with all the extensions that will break with SUPEE-6788

More info here: https://docs.google.com/spreadsheets/d/1LHJL6D6xm3vD349DJsDF88FBI_6PZvx_u3FioC_1-rg/edit#gid=0

4
  • I am really curious to know how this list was collected.
    – mam08ixo
    Commented Oct 21, 2015 at 19:53
  • 3
    It was crowdsourced; original source is: docs.google.com/spreadsheets/d/… Commented Oct 21, 2015 at 20:48
  • Please remove the list from the above page and link to the source instead, which is kept up-to-date: docs.google.com/spreadsheets/d/… Commented Oct 22, 2015 at 8:29
  • 1
    Is there any contact to let know about updated versions? I see there at least 2-3 modules that were already updated.
    – versedi
    Commented Nov 3, 2015 at 8:33
-1

The list of allowed variables, that can be processed via content filter, is bigger than was shown in the PDF:

+ trans_email/ident_support/name
+ trans_email/ident_support/email
web/unsecure/base_url
web/secure/base_url
trans_email/ident_general/name
+ trans_email/ident_general/email
trans_email/ident_sales/name
trans_email/ident_sales/email
trans_email/ident_custom1/name
trans_email/ident_custom1/email
trans_email/ident_custom2/name
trans_email/ident_custom2/email
general/store_information/name
general/store_information/phone
general/store_information/address

(I have added an + before the variables that were not described in the PDF)

The allowed blocks that can be processed via content filter are:

core/template
catalog/product_new

Not the answer you're looking for? Browse other questions tagged or ask your own question.