Summary
Wanderer can render attacker-controlled waypoint names or icons as HTML in its trail elevation graph without safely encoding or validating them. When a victim views the affected elevation profile, the injected script may run in their browser; malicious waypoint data can come from a local authenticated user or a federated instance.
Affected context
The issue occurs in Wanderer's MapLibre elevation-profile component, where waypoint name and icon values are interpolated into an innerHTML template. Deployments running versions before 0.19.3 may be affected when crafted waypoint data is displayed in an elevation profile. The data may be submitted by an authenticated local user or received through federation.
Exploit preconditions
- Attack surface: Waypoint data displayed in a trail elevation profile.
- Required access: An attacker may need a local account to submit waypoint data directly. Alternatively, malicious federated waypoint data may reach an instance without the attacker having a local account there.
- Trigger point: A victim views an elevation profile containing the crafted waypoint.
- Why exploitation is possible: The waypoint name and icon are inserted into HTML without adequate encoding or icon validation.
Why this happens
The component interpolates data that may be attacker-controlled into an innerHTML template without context-appropriate HTML encoding. The icon value is also not validated before rendering. This is a cross-site scripting flaw covered by CWE-79: Improper Neutralization of Input During Web Page Generation.
Potential impact
- Attacker-controlled script may execute in a victim's browser.
- Script could expose session data accessible to the page.
- Script could perform actions in the victim's context.
- User trust in shared or federated trail data could be undermined.
General mitigation guidance
Defensive patterns focus on treating waypoint data as untrusted and preventing it from becoming executable markup. Common approaches include:
- Render names and other text through framework APIs that escape content by default.
- Avoid assigning untrusted values to
innerHTML; use safe DOM construction or text-only insertion. - Validate icon values against a narrow allowlist of supported identifiers.
- Apply context-appropriate encoding at the point where data is rendered.
- Limit the privileges available to browser sessions and protect sensitive actions with appropriate authorization checks.
How teams detect issues like this
Detection can include:
- Static analysis rules that flag untrusted data interpolated into
innerHTMLor equivalent HTML sinks. - Code review checks for missing output encoding and unrestricted icon or markup values.
- Tests that verify waypoint fields are rendered as text and that icons are constrained to approved values.
- Policies requiring safe DOM APIs and review of data received through federation.

