From the 1.8CE Alpha release notes:

The Magento web store has additional Cross Site Request Forgery (CSRF) protections, meaning an imposter can no longer impersonate a newly registered customer and perform actions on the customer's behalf.


In earlier versions, Magento was vulnerable to a session fixation attack during the registration process. After logging in to their account, a registered user's session ID did not change. Therefore, if an attacker had knowledge of an unauthorized session ID and if that user successfully registers, the attacker was able to take over the newly registered account. Now, the session ID changes after successful registration, making unauthorized use of an account impossible.

If this is in the release notes, and I don't see a point-release on prior versions addressing this (am I looking in the wrong place?) - then does that mean that current pre-1.8 stores are potentially open to these attack vectors?

Source: http://www.magentocommerce.com/knowledge-base/entry/ce-18-later-release-notes

  • I just updated my answer below with details on getting a patch for these vulnerabilities. – davidalger Jul 6 '13 at 4:17

In short, yes. CE 1.7 is still vulnerable to those specific attacks because no security release has been issued which contains a patch.

In the case of the latter one, a session fixation attack, the change is an upgrade in the security practices which Magento already used to stay in line with current security best-practices. Not something likely to be issued to CE 1.7 if they do issue a patch with the CSRF fixes.

The real question is what exactly were these CSRF vulnerabilities which were fixed? Doubtless a good thing that they did not include specifics in the release notes, thus further jeopardizing all prior releases, but it would be nice to know for the sake of patching old implementations.

UPDATE #1: Upon reaching out to Magento to find out when they will be issuing patches for the above vulnerabilities, I received the following reply:

Allow me some time to research this further. I'm not sure if there are patches available for those two items, as they are listed in our system as product enhancements and not as bugs. I'll update you when I get more information.

I'll post back further details here as I get them, and will be doing my best to get patches issued since it seems that there are not currently any patches in existence.

UPDATE #2: After back and forth with the support team, I was able to obtain a proper patch for Magento EE No patch was issued for Magento CE, and as far as the technician who looked into it internally for me knows, there are no plans to release an official patch for CE 1.7.x instead resolving the issues only in the upcoming CE 1.8 stable release.

As for the EE specific patch file, I cannot post it (or the patch application tool) here directly since it would most undoubtedly be in violation of NDA between Magento and myself personally and the company for which I work. The name of the relevant patch is: "PATCH_SUPEE-1513_EE_1.12.0.2_v1.sh" — If you have the Enterprise Edition or a client using it, you should be able to request this patch from the Magento support team along with a note about the CSRF vulnerabilities which it is supposed to fix.

For CE users, I've taken the freedom to generate a patch file (based on the patch provided by Magento) which includes only the hunks of code which alter Magento CE core code files. In normal fashion, it includes irrelevant bits of added comments and adjusted formatting along with the relevant code changes. Creating this required manually altering the original patch to apply it using the provided patch applying tool, then using git to generate a patch based on the applied changes.

The patch file which I've created can be downloaded from this gist: https://gist.github.com/davidalger/5938568

To apply the patch, first cd into the root of your Magento installation and run the following command: patch -p1 -i ./Magento_CE_1.7.0.2_v1-CSRF_Patch.diff

The EE specific patch included form key validation checks to Enterprise specific controllers, alterations to enterprise/default and enterprise/iphone template files to include form keys in the forms being used for the patched controller actions, and additional Full Page Cache funtionality to properly account for passing form keys back and forth on cached pages.

DISCLAIMER: I have NOT TESTED either the EE patch provided by Magento nor the patch I've uploaded to the linked gist. The patch provided in the referenced gist is provided with NO WARRANTY and may or may not fully resolve the vulnerabilities referenced in the CE 1.8 release notes. As an untested patch, there is also no guarantee that it functions in whole or part. I.e. use at your own risk, and take due diligence to test before deploying to a production environment. If you find issues with the patch, let me know and I'll update it.

  • 1
    Security through obscurity is not a good idea. They should make it public so everyone can patch his installation. Furthermore a simple diff between the two versions should give you quite a good impression on how the attack works and how to patch older installations. Therefore the information is out anyway. – Darokthar Apr 30 '13 at 6:32
  • 1
    Agreed, obscurity is not good security at all, and I was certainly not trying to indicate that. However, responsible disclosure is something that must be considered. For all we know, the vulnerabilities could have been submitted to Magento weeks before the public release of EE 1.13 and CE 1.8a1. FWIW, I'll be contacting some folks at Magento to find out if they have patches for EE 1.12 yet and what plans are for 1.7 installations; specifically for the CSRF vulnerabilities. – davidalger Apr 30 '13 at 13:33
  • Let's watch for an update and edit the question/answer accordingly if a patch is released. Thanks. – philwinkle May 6 '13 at 15:52
  • I just posted an update with a preliminary reply I got from Magento. Seems there are not currently any patches, so I'm going to see what I can do about that. I'll definitely keep y'all posted… here and possibly on my twitter as well. – davidalger May 6 '13 at 21:25

I'm not 100% sure because I wasn't able to reproduce the issue but

meaning an imposter can no longer impersonate a newly registered customer

means that until now 'an imposter' could impersonate a newly registered customer.
I hope it is just 'semantics' but I think it means what you fear it means.

  • until now, means fixed in 1.8 - or what do you mean? – Fabian Blechschmidt May 6 '13 at 11:00
  • yeah...that is what I mean. – Marius May 6 '13 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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