We need to forward-port the OpenID security fix from SA-CORE-2012-003 to Drupal 8.
(See the OpenID module changes in http://drupalcode.org/project/drupal.git/commitdiff/b9127101ffeca819e74a...).
For Drupal 8, it's possible we can do a bit of a different fix since we can rely on the PHP function libxml_disable_entity_loader() always existing (which we couldn't do for all supported PHP versions in Drupal 7).
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | openid-security-fix-1816136-5.patch | 3.6 KB | David_Rothstein |
| #4 | openid-security-fix-1816136-4.patch | 3.6 KB | berdir |
| #2 | openid-security-fix-1816136-2.patch | 3.57 KB | berdir |
Comments
Comment #1
David_Rothstein commentedLet's also tag this issue as a D7 release blocker, since although the original fix from Drupal 7.16 was merged in to 7.x-dev already, we want to double check that the latest 7.x code is not vulnerable before doing the next bugfix release of Drupal core.
(In this particular case, I think the chance is around 0% that this is the case, but I'm tagging it anyway to keep track of it and because in theory it is always a possibility due to differences between the previous stable release that the security release was made from, and the current code in 7.x-dev. Per the new release policy, we are now able to do this step in the public issue queue as a followup, rather than having it be part of the security team's private work.)
Comment #2
berdirRe-rolled patch.
Simplified the check, not sure if we still need that doctype check, left it there for now.
Comment #4
berdirAdded a drupalLogout(), should pass now.
Comment #5
David_Rothstein commentedI reviewed and tested this patch and it seemed to work fine. (I'm attaching a version that fixes a code comment typo - missing capital letter at the beginning of a sentence - but no other changes.) This should be good to go for Drupal 8.
I also double checked that the latest 7.x-dev code isn't subject to this vulnerability, so I'm removing that tag as well.
For Drupal 8, we likely could rely on libxml_disable_entity_loader() entirely, but things get a little tricky there (it would require further refactoring to make sure the correct error messages still display and the tests still pass), so no real need to do it here. Removing the doctype entirely should always work anyway.
I was also a bit curious about why the Drupal 8 tests needed to specify the form ID here but the Drupal 7 ones didn't:
But @Berdir pointed out to me that it's because the OpenID forms were refactored in Drupal 8 in #1538462: Cannot log in with OpenID due to "required" attribute so that they're now separate from the user login form.
Comment #6
David_Rothstein commentedThere's actually a minor bug here:
Since the first return doesn't reset the libxml options to their original state, only the second one.
But that's very minor and exists in Drupal 7 too, so I think this is still RTBC.
Comment #7
webchickYeah, let's get this sucker in and then we can file that as a minor follow-up.
Committed and pushed to 8.x. Back to 7.x.
I used the following commit message, crafted from the SA:
Issue #1816136 by Berdir, David_Rothstein, ubercomp, c960657, wojtha, fgm, pwolanin, Damien Tournoud, Heine: Fixed OpenID vulnerability from SA-CORE-2012-003 (and backport anything to 7.x-dev as necessary).
Comment #8
David_Rothstein commentedThere are no longer any security issues in 7.x here, so moving back to 8.x for possible followups discussed above - or it could be a separate issue but I don't have the energy to file one right now :)
Comment #9
swentel commentedMoving to the openid module since the module is not in D8 anymore.