Skip to main content
Menu
Advisories

Summary @rsdoctor/client before version 1.6.5 renders several ECharts tooltip values as HTML without escaping build-derived content

GHSA-RG97-4RJ9-W6RJPublished Updated GitHub

Description

@rsdoctor/client before version 1.6.5 renders several ECharts tooltip values as HTML without escaping build-derived content.

A malicious dependency can include a source file whose filename contains HTML. When that file is processed during a build and the user opens the Rsdoctor loader timeline and hovers the corresponding entry, the filename is interpolated into the tooltip HTML and attacker-controlled JavaScript can execute in the report viewer's origin.

Impact

An attacker who can cause a project to build a dependency containing a malicious filename can execute JavaScript in the origin hosting the Rsdoctor report viewer.

The affected tooltip formatters render loader names, resource paths, loader layers, and plugin trace names. These values originate from build data and are inserted into ECharts tooltip HTML without output encoding.

A successful exploit requires user interaction: the user must open the generated report and hover the affected loader or plugin timeline entry. The injected script can access and modify data available to the report viewer, such as the rendered report DOM and browser storage. Depending on the report configuration, this may include build metadata and source content displayed by the report.

Affected Versions

@rsdoctor/client versions before 1.6.5 are affected.

Patches

The issue is fixed in @rsdoctor/client version 1.6.5.

The fix HTML-encodes build-derived values before they are interpolated into ECharts tooltip templates.

Reproduction

  1. Create or install a dependency containing a JavaScript source file with HTML in its filename, for example:
   evil<img src=x onerror="alert(document.domain)">.js
  1. Import that file from a project built with the Rsdoctor Webpack or Rspack plugin with loader analysis enabled.
  2. Open the generated Rsdoctor report and navigate to the Loaders timeline.
  3. Hover the loader entry corresponding to the malicious resource.

In affected versions, the filename is rendered as tooltip HTML and the onerror handler executes. In version 1.6.5 and later, the filename is displayed as escaped text.

Workarounds

Upgrade to @rsdoctor/client version 1.6.5 or later. If upgrading is not immediately possible, avoid opening Rsdoctor reports generated from builds that include untrusted dependencies or source files.

Affected versions

References

GitHub · web-infra-dev/rsdoctor