Commit Graph
6 Commits
Author SHA1 Message Date
Isaac ConnorandClaude Opus 4.8 47d7e0d37f fix: escape Zone, Event and Server names on output
Zone.Name, Event.Name, Event.Notes and Server.Name are persisted
user-controllable strings that were emitted without escaping, so a user
with edit rights on the object could store markup that runs in the
browser of anyone who later views the page, including an administrator.
Zone and Server save through getFormChanges + raw SQL, so they never
pass the object filter_regexp layer that strips markup elsewhere.

HTML and SVG sinks now use validHtmlStr():
- Zone::svg_polygon() escapes the <title>, covering every caller
  (event view, montage and stream).
- views/zone.php and views/plugin.php headings.
- ajax/modals/server.php modal title.

The two inline-JS sinks in views/js/event.js.php are require_once'd
inside a <script nonce> block, so a </script> in Event.Name or Notes
broke out of the element and the nonce did not help. Notes was also
interpolated into a template literal, making backtick and ${} live.
Both now emit json_encode(..., JSON_HEX_TAG|JSON_HEX_APOS|
JSON_HEX_QUOT|JSON_HEX_AMP), which supplies its own double quotes.

Refs GHSA-72c3-g86w-f587.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-19 12:39:35 -04:00
Isaac Connor a5916f01d1 Protect against XSS in server db values 2024-01-25 19:34:46 -05:00
Isaac Connor 914f7e0ae2 APply validCardinal to sid so that arrays don't get passed to new Server() which then prevents XSS 2024-01-24 19:25:15 -05:00
Isaac Connor 042edd25e5 Add classes to tr so they can be styled 2023-08-08 09:54:47 -04:00
Isaac Connor f96c90ffa7 Fix saving Server modal. Form was incomplete, action and view were duplicated. Don't need javascript just use the submit button Save. 2022-10-26 09:00:25 -04:00
Andrew Bauer 2757b74957 convert servermodal function to php file 2020-09-18 10:34:33 -05:00