? ? Success

User tests: Successful: Unsuccessful:

avatar SniperSister
SniperSister
5 May 2020

Summary of Changes

Older versions of libxml and/or specific configurations are vulnerable to so called XML External Entity Processing vulnerabilities, short XXE:
https://owasp.org/www-community/vulnerabilities/XML_External_Entity_(XXE)_Processing

In order to harden J4 against such attacks, we should disable the loading of external entites by default.

Testing Instructions

Test parts of the CMS related to XML processing i.e.:

  • Parse RSS feeds using mod_feed
  • Purge the extension cache in the extension manager
  • Install an extension with an update server being enable

Expected result

Features continue to work as expected.

Documentation Changes Required

3rd party developers relying on external entity processing need to be aware of that change.

avatar SniperSister SniperSister - open - 5 May 2020
avatar SniperSister SniperSister - change - 5 May 2020
Status New Pending
avatar richard67
richard67 - comment - 5 May 2020

@SniperSister Please use tabs instead of spaces for indentation to fix PHPCS errrors mentioned by Drone.

avatar SniperSister SniperSister - change - 5 May 2020
Labels Added: ?
avatar SniperSister
SniperSister - comment - 5 May 2020

@richard67 thanks, fixed!

avatar richard67
richard67 - comment - 5 May 2020

@SniperSister Drone still wasn't happy with PHPCS of comments, have corrected that for you.

avatar richard67
richard67 - comment - 6 May 2020

@SniperSister I've just tested everything and a bit more than described, but I have a problem with langmetadata.xml. On the site (frontend) I get:

Warning: simplexml_load_file(): I/O warning : failed to load external entity "/joomla-cms-4.0-dev/language/en-GB/langmetadata.xml" in /joomla-cms-4.0-dev/libraries/src/Language/LanguageHelper.php on line 682

I don't really understand why simplexml finds an external entity in this file https://github.com/joomla/joomla-cms/blob/4.0-dev/language/en-GB/langmetadata.xml.

In the backend that doesn't happen.

avatar SniperSister
SniperSister - comment - 6 May 2020

@richard67 that's indeed super weird. Reproducible on multiple machines?

avatar richard67
richard67 - comment - 6 May 2020

@SniperSister I have only one available right now, it's Linux.

avatar richard67
richard67 - comment - 6 May 2020

PHP version 7.3.11-0ubuntu0.19.10.4

avatar wilsonge
wilsonge - comment - 30 May 2020

If we're doing this it needs to go in all 3 framework.php files for each of the applications

avatar carcam carcam - test_item - 4 Jun 2020 - Tested successfully
avatar carcam
carcam - comment - 4 Jun 2020

I have tested this item successfully on 8a38637

I have tested this adding https://community.joomla.org/blogs/community.feed feed to the site and also installing a J4 extension and it's correctly processed in both cases.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28949.

avatar pabloarias pabloarias - test_item - 4 Jun 2020 - Tested successfully
avatar pabloarias
pabloarias - comment - 4 Jun 2020

I have tested this item successfully on 8a38637

I've tested this path showing a RSS feed in frontend with News Feeds core component. After apply path it continues working.

I've installed a component too and purged the extensions cache in the extension manager, after search for updates, it works.

Thank you!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28949.

avatar Quy Quy - change - 4 Jun 2020
Status Pending Ready to Commit
avatar Quy
Quy - comment - 4 Jun 2020

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28949.

avatar mbabker
mbabker - comment - 4 Jun 2020

Not RTC. George pointed out a required change, that has not been made.

avatar Quy Quy - change - 4 Jun 2020
Status Ready to Commit Pending
avatar SharkyKZ
SharkyKZ - comment - 12 Jun 2020

I get the same warning as @richard67. PHP 7.2.5~7.4.6 on Windows.

avatar SharkyKZ
SharkyKZ - comment - 6 Sep 2020

libxml_disable_entity_loader() is deprecated in PHP 8.0.

avatar paritshivani paritshivani - test_item - 5 Dec 2020 - Tested successfully
avatar paritshivani
paritshivani - comment - 5 Dec 2020

I have tested this item successfully on 8a38637


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28949.

avatar brianteeman
brianteeman - comment - 18 Jan 2021

@SniperSister @zero-24 as this is a security issue it would be good to get this resolved.

avatar zero-24 zero-24 - change - 18 Jan 2021
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - change - 18 Jan 2021
Category Administration
avatar zero-24
zero-24 - comment - 18 Jan 2021

I have just added the relevant changes to the administrator and api location as requested.

avatar wilsonge
wilsonge - comment - 19 Jan 2021

@richard67 can you still reproduce your error with the metadata?

avatar richard67
richard67 - comment - 19 Jan 2021

@richard67 can you still reproduce your error with the metadata?

@wilsonge Unfortunately yes:

2021-01-19_j4-pr-28949

I only made a new installation of current 4.0-dev, then switched error reporting to maximum (and server time zone to "Europe/Berlin", but I think that's not relevant here) in Global Configuration, then installed Patchtester 4, entered the GitHub token in Patchtester access information, then fetched the PRs in Patchtester, applied the patch of this PR, and then I got the above result.

From system info:

  • PHP Version = 7.3.11-0ubuntu0.19.10.6
  • Web Server = Apache/2.4.41 (Ubuntu)
  • WebServer to PHP Interface = apache2handler
avatar chmst chmst - change - 31 Jan 2022
Labels Added: ? ?
Removed: ? ?
avatar laoneo
laoneo - comment - 13 Jun 2022

I would close this as the function got deprecated in PHP 8.0, because it does this automatically as mentioned here https://php.watch/versions/8.0/libxml_disable_entity_loader-deprecation. If we really want to patch it, then I would also add a php check to execute the function only in PHP < 8.0.

avatar SniperSister SniperSister - change - 20 Jun 2022
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2022-06-20 07:04:22
Closed_By SniperSister
Labels Added: ?
Removed: ?
avatar SniperSister
SniperSister - comment - 20 Jun 2022

Closed for the reasons mentioned by @laoneo

avatar SniperSister SniperSister - close - 20 Jun 2022

Add a Comment

Login with GitHub to post a comment