Files
once-campfire/app/controllers
Jeremy Daer 424219e485 Serve custom styles from a dedicated text/css route
Admin-authored custom styles were rendered inline into every page via
custom_styles_tag, marked html_safe inside a <style> element. A stored
payload containing </style><script>…</script> broke out of the style
context and executed as HTML — a stored XSS reaching everyone who
loads the app.

Deliver the styles as an external stylesheet instead, following the
account logo pattern: a new Accounts::CustomStyles#show renders the
raw CSS with a text/css content type (ETag on the account, 5-minute
public cache with stale-while-revalidate, fresh_custom_styles cache
buster on account updates), and the layout links it with
<link rel="stylesheet" data-turbo-track="reload">. In a CSS
document, markup is inert text — the HTML-context breakout is closed
by construction, and admins keep full custom-CSS capability.
2026-08-08 17:24:52 -07:00
..
2025-08-21 09:31:59 +01:00
2025-08-21 09:31:59 +01:00
2025-08-21 09:31:59 +01:00
2025-08-21 09:31:59 +01:00
2025-08-21 09:31:59 +01:00
2025-08-21 09:31:59 +01:00
2025-08-21 09:31:59 +01:00
2025-08-21 09:31:59 +01:00
2025-08-21 09:31:59 +01:00