Problem/Motivation

This module does not escape a label in the Matomo admin settings form.

Steps to reproduce

You can see this vulnerability by:

  1. Enabling the module
  2. As a user with "administer permissions" permission, create or edit an existing role with HTML in name. For example <img src="csrf">.
  3. As a user with "administer matomo" permission access /admin/config/system/matomo, open tab "Roles" and check the role with label containing HTML.
  4. HTML is inserted unescaped into the vertical tab summary.
    Vertical tab summary of "Roles" with a broken image.

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">&lt;img src=&quot;csrf&quot;&gt;</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.

CommentFileSizeAuthor
Screenshot 2025-09-12 112235.png57.03 KBhosterholz

Issue fork matomo-3554029

Command icon 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

hosterholz created an issue. See original summary.

hosterholz’s picture

Issue summary: View changes
hosterholz’s picture

Issue summary: View changes

c-logemann’s picture

This is a very special situation but should be fixed. Thanks for reporting this at first to the security team and creating the patch.

c-logemann’s picture

Priority: Normal » Major
Status: Active » Needs review
c-logemann’s picture

Assigned: Unassigned » c-logemann

c-logemann’s picture

Assigned: c-logemann » Unassigned
Status: Needs review » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.