Skip to content

Commit 716fc66

Browse files
Merge branch 'main' into immichIntegration
2 parents 898956c + 3c7308a commit 716fc66

10 files changed

Lines changed: 67 additions & 11 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
# [Unreleased]
1+
# 0.19.3
22

3-
## Features
4-
- Server-side map clustering and zoom-aware polyline filtering: The world map now performs trail clustering on the server to improve performance. At lower zoom levels, smaller trails are clustered, while at higher zoom levels the largest routes in the current view are shown as detailed polylines. The maximum number of simultaneously visible polylines can be configured via the PUBLIC_MAP_MAX_POLYLINES environment variable.
3+
## Security
4+
- Fixed unauthenticated IDOR on `GET /activitypub/trail/{id}` and `GET /activitypub/comment/{id}` — private records are now access-checked before being returned. (GHSA-9qg7-jr2x-prvh, reported by [@de3erve-hunter](https://github.com/de3erve-hunter))
5+
- Fixed stored XSS via `waypoint.icon` in map markers — the icon value is now validated against an allowlist before being passed to `insertAdjacentHTML`. (GHSA-hx3v-rv4v-w875, reported by [@de3erve-hunter](https://github.com/de3erve-hunter))
6+
- Fixed stored XSS via `waypoint.name` and `waypoint.icon` in the elevation profile — replaced unsafe `innerHTML` assignment with safe DOM construction. (GHSA-m7v2-6gj3-3g2p, reported by [@de3erve-hunter](https://github.com/de3erve-hunter))
57

68
# v0.19.2
79
## Documentation

SECURITY.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
Please report security vulnerabilities through [GitHub Private Advisories](https://github.com/open-wanderer/wanderer/security/advisories/new). Do not open a public issue.
6+
7+
We will acknowledge your report within 72 hours and aim to release a fix within **60 days**. If we need more time we will let you know. We will credit you in the advisory and changelog when the fix is published.
8+
9+
## Scope
10+
11+
**In scope:**
12+
- Vulnerabilities in this codebase that would affect any self-hosted Wanderer instance
13+
14+
**Out of scope:**
15+
- `wanderer.to` and any other publicly hosted instances — do not test against servers you do not own or operate
16+
- Vulnerabilities in third-party dependencies — please report those upstream
17+
- Theoretical issues without a working proof of concept
18+
19+
## Supported Versions
20+
21+
Only the latest release receives security fixes. We do not backport patches to older versions.

db/routes/activitypub.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,18 @@ func ActivitypubTrail(e *core.RequestEvent) error {
183183
id := e.Request.PathValue("id")
184184

185185
trail, err := e.App.FindRecordById("trails", id)
186+
if err != nil {
187+
return e.NotFoundError("trail not found", nil)
188+
}
189+
190+
reqInfo, err := e.RequestInfo()
186191
if err != nil {
187192
return err
188193
}
194+
canAccess, err := e.App.CanAccessRecord(trail, reqInfo, trail.Collection().ViewRule)
195+
if err != nil || !canAccess {
196+
return e.NotFoundError("trail not found", nil)
197+
}
189198

190199
trailObject, err := util.ObjectFromTrail(e.App, trail, nil)
191200
if err != nil {
@@ -198,9 +207,18 @@ func ActivitypubComment(e *core.RequestEvent) error {
198207
id := e.Request.PathValue("id")
199208

200209
comment, err := e.App.FindRecordById("comments", id)
210+
if err != nil {
211+
return e.NotFoundError("comment not found", nil)
212+
}
213+
214+
reqInfo, err := e.RequestInfo()
201215
if err != nil {
202216
return err
203217
}
218+
canAccess, err := e.App.CanAccessRecord(comment, reqInfo, comment.Collection().ViewRule)
219+
if err != nil || !canAccess {
220+
return e.NotFoundError("comment not found", nil)
221+
}
204222

205223
commentObject, err := util.ObjectFromComment(e.App, comment, nil)
206224
if err != nil {

docs/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "docs",
33
"type": "module",
4-
"version": "0.19.2",
4+
"version": "0.19.3",
55
"scripts": {
66
"dev": "astro dev",
77
"start": "astro dev",

docs/src/content/docs/changelog.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
title: Changelog
33
description: What changed in the last patch?
44
---
5+
## v0.19.3
6+
7+
### Security
8+
- Fixed unauthenticated IDOR on `GET /activitypub/trail/{id}` and `GET /activitypub/comment/{id}` — private records are now access-checked before being returned. (GHSA-9qg7-jr2x-prvh, reported by [@de3erve-hunter](https://github.com/de3erve-hunter))
9+
- Fixed stored XSS via `waypoint.icon` in map markers — the icon value is now validated against an allowlist before being passed to `insertAdjacentHTML`. (GHSA-hx3v-rv4v-w875, reported by [@de3erve-hunter](https://github.com/de3erve-hunter))
10+
- Fixed stored XSS via `waypoint.name` and `waypoint.icon` in the elevation profile — replaced unsafe `innerHTML` assignment with safe DOM construction. (GHSA-m7v2-6gj3-3g2p, reported by [@de3erve-hunter](https://github.com/de3erve-hunter))
11+
512
## v0.19.2
613
### Documentation
714
- Add CONTRIBUTING guidelines

web/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "wanderer",
3-
"version": "0.19.2",
3+
"version": "0.19.3",
44
"private": true,
55
"scripts": {
66
"dev": "vite dev",

web/src/lib/util/maplibre_util.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,10 @@ export function syncMarkerHighlightClass(
4343
}
4444

4545
export function createMarkerFromWaypoint(waypoint: Waypoint, onDragEnd?: (marker: M.Marker, wpId?: string) => void): FontawesomeMarker {
46+
const safeMarkerIcon = waypoint.icon && icons.includes(waypoint.icon) ? waypoint.icon : "circle";
4647
const marker = new FontawesomeMarker({
4748
id: waypoint.id,
48-
icon: `fa fa-${waypoint.icon}`,
49+
icon: `fa fa-${safeMarkerIcon}`,
4950
}, {
5051
draggable: onDragEnd !== undefined,
5152
color: "#6b7280"

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

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -707,7 +707,14 @@ export class ElevationProfile {
707707
wpDiv.style.top = `8px`; // Position horizontally
708708

709709
// Add custom HTML content (e.g., icon + label)
710-
wpDiv.innerHTML = `<div class="tooltip" data-title="${this.waypoints[index]?.name ?? "?"}"><i class="fa fa-${this.waypoints.at(index)?.icon ?? 'circle'}"></i></div>`;
710+
const tooltipDiv = document.createElement("div");
711+
tooltipDiv.className = "tooltip";
712+
tooltipDiv.dataset.title = this.waypoints[index]?.name ?? "?";
713+
const iconEl = document.createElement("i");
714+
const safeIcon = this.waypoints.at(index)?.icon ?? "circle";
715+
iconEl.className = `fa fa-${/^[a-z0-9-]+$/.test(safeIcon) ? safeIcon : "circle"}`;
716+
tooltipDiv.appendChild(iconEl);
717+
wpDiv.appendChild(tooltipDiv);
711718

712719
waypointContainer.appendChild(wpDiv); // Add to container
713720
});

0 commit comments

Comments
 (0)