Warn moderators when HTML RichText contains JavaScript or active HTML
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
Research direction
Start with sanitize(...) in app/views/rich_texts/_rich_text.html.erb and _grid.html.erb, then read RichText#as_json and ConcertoRichText.vue to confirm what the player intentionally leaves active. Run the existing RichText model/view tests before adding detection for executable or stripped HTML and the warning banner with collapsible raw source. Done means previews and moderation cards warn consistently and tests cover detection and display. A linked pull request (#2095) is already open, so coordinate before starting.
Written by the indexing model from the issue text.
Description
Context
Related to #1759 and #2039.
Allowing HTML RichText content to render unsanitized on the frontend player (ConcertoRichText.vue) is Working As Intended so trusted signage deployments can use rich/dynamic HTML and JavaScript. However, admin and moderation previews (app/views/rich_texts/_rich_text.html.erb and _grid.html.erb) sanitize HTML via Rails sanitize(...) to protect authenticated administrators.
Because admin previews strip <script>, inline on* event handlers, javascript: URIs, <iframe>, <object>, <embed>, <svg>, <style>, etc., moderators cannot see active HTML/JS when reviewing submissions before approving them for display on screens.
Proposed Fix
- Keep frontend player HTML rendering intact (do not strip JS from
ConcertoRichText.vueorRichText#as_json). - Detect potentially executable or sanitized-away HTML in HTML
RichTextcontent (e.g.,<script>,on*attributes,javascript:URIs,<iframe>,<object>,<embed>,<svg>,<style>, or differences between raw and sanitized HTML). - Display a clear warning banner on
RichTextpreviews and moderation cards whenever active/stripped HTML is detected, along with a safe collapsible raw HTML source viewer (<details>) so moderators can inspect what will run on screens. - Add model/helper/view/controller tests covering detection and warning display.
- Dominant language
- Ruby
- Stars
- 485
- Forks
- 178
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 29
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from concerto/concerto
-
agent-driven deployment documentation future releases nice to have
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
agent-driven future releases nice to have
Difficulty 3/5 1-2 days Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
agent-driven deployment documentation future releases infrastructure
Difficulty 4/5 3-5 days Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in concerto/concerto
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
TarteelAI/quranic-universal-library#1111 ·
Maintainers usually reply within 1 day
-
Generated cask uses deprecated `postflight` stanza; Homebrew 7 warns on every commandPossibly taken @k4kratik claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
sachincool/cruft#4 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
riscv/riscv-unified-db#2859 ·
Maintainers usually reply within 2 days
-
changesets
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
openstreetmap/openstreetmap-website#7629 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
we-promise/sure#5742 · 1 comment ·
Maintainers usually reply within 1 day