XSS vulnerability: dangerouslySetInnerHTML in chart component

Aperta
#58 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
next.js, python, typescript

Direzione di ricerca

Start by reading src/components/ui/chart.tsx around line 81 and trace the value passed to __html, then inspect scripts/scrape_professors.py around line 51. Check whether chart content can contain user-controlled data and where SSL verification is disabled. Done means both unsafe rendering and disabled certificate verification are addressed, with behavior preserved when HTML is not required.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

advanced bug enhancement

🔍 Issue

`src/components/ui/chart.tsx:81` uses `dangerouslySetInnerHTML` to render chart content.

Context

This appears to be a custom chart component that renders HTML inside the chart labels/tooltips. If any chart data (labels, tooltips, axis values) comes from user input (e.g., course names, professor names, review text), malicious HTML could be injected.

✅ Fix

If this is a shadcn/ui or Radix chart component, the `dangerouslySetInnerHTML` is likely unnecessary. Check:

  1. What data is being passed to the `__html` prop?
  2. Can any of that data be user-controlled?
  3. Switch to safe DOM text rendering or use DOMPurify if HTML rendering is required.

Additionally, `scripts/scrape_professors.py:51` uses `requests.get(url, verify=False)` — disabling SSL verification is dangerous and should be fixed in production.

Lingua principale
TypeScript
Stelle
0
Fork
26
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenLake/RateMyCourse

Tutte le issue di OpenLake/RateMyCourse

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.