Skip to content

fix: defensive hardening across SkyAware frontend - #312

Open
zagers wants to merge 1 commit into
flightaware:masterfrom
zagers:fix/frontend-hardening
Open

fix: defensive hardening across SkyAware frontend#312
zagers wants to merge 1 commit into
flightaware:masterfrom
zagers:fix/frontend-hardening

Conversation

@zagers

@zagers zagers commented Jul 19, 2026

Copy link
Copy Markdown

Summary

Grouped low-severity defensive fixes across the SkyAware frontend for security hardening.

Changes

  • script.js: restrictUrlRequest — add isFinite() check to prevent NaN from being stored in localStorage
  • script.js: flag_image — validate filename pattern (/^[a-zA-Z0-9_-]+\.png$/) before setting img src, preventing path traversal if data source changes
  • script.js: Altitude table cell — use DOM manipulation (createElement/textContent) instead of innerHTML
  • formatter.js: Add format_altitude_text() and format_vert_rate_triangle() helpers that return plain text without HTML

Deferred

  • CSRF protection on AJAX fetches — requires server-side changes (SameSite cookies, Origin checks)

Fixes #310

- restrictUrlRequest: add isFinite check to prevent NaN in localStorage
- flag_image: validate filename pattern before setting img src
- altitude cell: use DOM manipulation instead of innerHTML

Fixes flightaware#310
@mutability mutability added the LLM has LLM-generated content, treat with extreme suspicion label Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

LLM has LLM-generated content, treat with extreme suspicion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Harden SkyAware frontend: defensive checks across script.js

2 participants