XSS vulnerability in facet results

Created on 11 March 2024, 10 months ago
Updated 11 July 2024, 5 months ago

Problem/Motivation

This module does not sanitize facet results before using them so it can lead to an XSS injection. If an attacker can write content that is indexed in the facet source, they could inject dangerous JS in the page.

Steps to reproduce

  1. Have a facet result containing a <img src="x" onerror="alert(`XSS`)">.
  2. Then start typing "a" in the autocomplete field.
  3. The JS is executed.

Proposed resolution

AutoCompleteWidget::build() could do something like this:

Html::escape($result->getDisplayValue())
🐛 Bug report
Status

Fixed

Version

2.1

Component

Code

Created by

🇫🇷France prudloff Lille

Live updates comments and jobs are added and updated live.
  • Security

    It is used for security vulnerabilities which do not need a security advisory. For example, security issues in projects which do not have security advisory coverage, or forward-porting a change already disclosed in a security advisory. See Drupal’s security advisory policy for details. Be careful publicly disclosing security vulnerabilities! Use the “Report a security vulnerability” link in the project page’s sidebar. See how to report a security issue for details.

Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024