Skip to content

Stored XSS via waypoint.name and waypoint.icon in Elevation Profile innerHTML

High
Flomp published GHSA-m7v2-6gj3-3g2p Jul 2, 2026

Software

wanderer

Affected versions

<= v0.19.2

Patched versions

None

Description

Summary

The elevation profile chart injects waypoint.name and waypoint.icon directly into a template literal assigned to innerHTML without escaping, providing a second independent XSS sink reachable via the trail elevation graph and via federation.

Details

web/src/lib/vendor/maplibre-elevation-profile/elevationprofile.ts line 710:

wpDiv.innerHTML = `<div class="tooltip" data-title="${this.waypoints[index]?.name ?? "?"}"><i class="fa fa-${this.waypoints.at(index)?.icon ?? 'circle'}"></i></div>`

Both fields are interpolated without HTML encoding. A name of "><script>alert(1)</script><div data-title=" closes the attribute and injects script. The server SanitizeHTML hook sanitizes only waypoints.description. Federated waypoints synced via syncWaypoints() (remote_trail.go) are processed without sanitization, enabling cross-instance exploitation.

PoC

curl -s -X POST 'https://target/api/collections/waypoints/records' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"trail":"<TRAIL_ID>","lat":48.0,"lon":11.0,"name":"\"><script>alert(document.cookie)<\/script><div data-title=\"x","icon":"circle"}'
# Any user viewing the trail elevation profile triggers the XSS

Impact

Stored XSS executed for every user who views the trail's elevation profile. The federation attack path allows cross-instance exploitation without a local account.

Fix

Replace the innerHTML template literal with safe DOM construction using textContent for name and an icon allowlist:

const tooltipDiv = document.createElement('div');
tooltipDiv.dataset.title = waypoint.name ?? '?';
const safeIcon = ALLOWED_ICONS.includes(waypoint.icon) ? waypoint.icon : 'circle';

Also add 'name' and 'icon' to server-side sanitization in util/sanitize.go.

If possible, please apply for a CVE number when publishing. I would greatly appreciate it.

Severity

High

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
High
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:L/A:N

CVE ID

CVE-2026-62346

Weaknesses

Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')

The product does not neutralize or incorrectly neutralizes user-controllable input before it is placed in output that is used as a web page that is served to other users. Learn more on MITRE.