fix: security hardening - XSS, CORS, and cache headers #1
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix/security-hardening"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
<script>tags to prevent XSS via</script>breakout in station names (render.ts)Access-Control-Allow-Origin: *to all JSON API responses (server.ts)Cache-Controlheaders to static files (CSS: 1h, favicon: 24h) (server.ts)Details
Station names from the API are embedded directly into JavaScript via
JSON.stringify(). A station name containing</script>could break out of the script tag. AddedsafeJsonForScript()that escapes closing script tags in JSON output.Test plan
bun testto ensure existing tests pass