Problem/Motivation
This module does not escape a label in the Matomo admin settings form.
Steps to reproduce
You can see this vulnerability by:
- Enabling the module
- As a user with "administer permissions" permission, create or edit an existing role with HTML in name. For example
<img src="csrf">. - As a user with "administer matomo" permission access /admin/config/system/matomo, open tab "Roles" and check the role with label containing HTML.
- HTML is inserted unescaped into the vertical tab summary.
Proposed resolution
When the label is created via PHP, HTML::escape is used to escape special characters. The code looks like this:
<label for="edit-matomo-visibility-user-role-roles-4" class="form-item__label option"><img src="csrf"></label>
When the label is checked and the summary is updated via JavaScript, the label is considered text, HTML entities are decoded and then written to the tab summary. A solution could be treating the role labels as HTML.
| Comment | File | Size | Author |
|---|---|---|---|
| Screenshot 2025-09-12 112235.png | 57.03 KB | hosterholz |
Issue fork matomo-3554029
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
hosterholzComment #3
hosterholzComment #5
c-logemannThis is a very special situation but should be fixed. Thanks for reporting this at first to the security team and creating the patch.
Comment #6
c-logemannComment #7
c-logemannComment #9
c-logemann