Affects Version/s: 188.8.131.52 DXP SP1
Fix Version/s: None
I want to bet that I didn't pick the proper component - but it's the best I could find. Please correct if necessary.
Walking the links on a page with a HEAD request will happily remove all portlets from the page through triggering the "remove portlet from page" link. This was discovered when implementing a link-walker that checks validity of links (e.g. do they generate 404?) from the context of the current user.
Steps to reproduce:
- Log in with administrative permissions (at least for the page)
- Add the following code to your page - e.g. through your page setup, or through a portlet:
- (observe the console about the links walked)
- (observe network traffic on the URLs triggered)
- Reload the page and observe that all portlets have been removed from the page.
A GET or HEAD request never should trigger such a destructive action IMHO. While this is in the context of the currently logged in user, it's not been unheard of that browser plugins walk through various contained links on the page.
It vaguely reminds me of the old story when the google crawler repeatedly deleted a full website over night, because it crawled publicly available destructive operations with GET. Here the links (and permissions) are at least not available publicly, but I've been astonished to suddenly realize that my content went missing silently.
(thanks Jan Verweij for the idea to walk links with JS. A quick fix for the script is to walk $(".portlet-body a") instead of $("a"), but this ticket is not about fixing this script, it's about the platform's behavior)