From b8e39cc357685283de480ccb1e1204ded75519f8 Mon Sep 17 00:00:00 2001 From: Matteo Mattiuzzi Date: Sat, 19 Sep 2026 20:11:26 +0000 Subject: [PATCH 1/2] security: escape registry and queue data in the admin and dashboard UIs --- earthgrid-core/assets/beacon.html | 12 ++++++------ earthgrid-core/assets/ui.html | 24 ++++++++++++++---------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/earthgrid-core/assets/beacon.html b/earthgrid-core/assets/beacon.html index cba90da..851a806 100644 --- a/earthgrid-core/assets/beacon.html +++ b/earthgrid-core/assets/beacon.html @@ -236,7 +236,7 @@

🛰️ Spatial Coverage

shape.on('click', () => showCoverageDetail(colId, cell)); shape.bindTooltip( - sensorLabel(colId) + (cell.tile_id ? ' · Tile ' + cell.tile_id : '') + '
' + + sensorLabel(colId) + (cell.tile_id ? ' · Tile ' + esc(cell.tile_id) : '') + '
' + pct.toFixed(1) + '% of archive · ' + cell.date_count + ' dates', {className:'', sticky:true} ); @@ -306,7 +306,7 @@

🛰️ Spatial Coverage

for (const m of allMonths) { const h = m.count > 0 ? Math.max(4, (m.count / maxCount) * 56) : 0; const color = m.count > 0 ? covColor(m.count * 3) : 'var(--border)'; - const qLabel = m.month + ' (Q' + (Math.ceil(parseInt(m.month.split('-')[1]) / 3)) + ')'; + const qLabel = esc(m.month) + ' (Q' + (Math.ceil(parseInt(m.month.split('-')[1]) / 3)) + ')'; barsHtml += '
'; } @@ -331,7 +331,7 @@

🛰️ Spatial Coverage

const bands = cell.bands || []; const bandsHtml = bands.length > 0 - ? bands.map(b => '' + b + '').join('') + ? bands.map(b => '' + esc(b) + '').join('') : 'unknown'; // Compute bbox from polygon if needed @@ -345,7 +345,7 @@

🛰️ Spatial Coverage

panel.innerHTML = '
' + '

' + sensorLabel(colId) + - (cell.tile_id ? ' · ' + cell.tile_id : '') + '

' + + (cell.tile_id ? ' · ' + esc(cell.tile_id) : '') + '' + '
' + coordsInfo.map(v => v.toFixed(1) + '°').join(', ') + '
' + '