task: harden the third-party script path for the docs assistant (no SRI, no crossorigin, no CSP)
I maintainer di solito rispondono entro 4 giorni
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- javascript
- Ambito
- documentation, security
Direzione di ricerca
Inizia dalle righe 16-20 di assistant.js ed esamina docs.json, ANALYTICS.md e AGENTS.md per conoscere le convenzioni attuali per script e documentazione. Conferma quali controlli supporta Mintlify, quindi registra la decisione selezionata e il relativo ragionamento. Il lavoro è completato quando il controllo applicabile dello script è in atto e la documentazione referenziata e i passaggi di rilascio sono stati aggiornati.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Follow-up from the review of #2286. Not a blocker for that PR — the branded host has landed and the loader is scoped — but the hardening gap it identified is still open and now has no home.
What is true today
assistant.js injects a third-party script onto every published page with no integrity or origin controls:
// assistant.js:16-20
var script = document.createElement('script');
script.src = WIDGET_SRC; // https://docs-assistant.celo.org/widget.js
script.dataset.apiUrl = 'https://docs-assistant.celo.org/api/chat';
script.referrerPolicy = 'strict-origin';
- No
integrityattribute and nocrossOrigin— verified:grep -c "integrity\|crossOrigin" assistant.jsreturns0. - No CSP anywhere in the repo to fall back on — there is no
vercel.json, no_headers, no middleware, anddocs.jsonhas noheaderskey (verified by loadingdocs.jsonand checking for the key).
Per AGENTS.md §1, any .js under the content root runs on every published page with full same-origin DOM access — including the pages that print contract addresses and RPC endpoints.
Impact
Whoever controls docs-assistant.celo.org can execute arbitrary JS on every docs page. That is currently us, which is why this is a follow-up and not a blocker. The residual risk is a compromise or misconfiguration of that host silently becoming a compromise of the docs, with no second control to catch it. A reader copying a contract address has no way to tell.
Why this is not simply "add SRI"
widget.js is first-party and expected to change on its own deploy cadence. An integrity hash pins one build, so adding SRI naively breaks the widget on the next widget deploy. Options worth weighing:
- Pin SRI and add a release step that updates the hash in
assistant.js(couples two repos, but fails closed). - Add
crossOrigin="anonymous"now — cheap, no downside, and a prerequisite for SRI later. - Ask Mintlify whether response headers (CSP with
script-src) are configurable on the current plan; if so, an allowlist fordocs-assistant.celo.orgis stronger than SRI and does not break on deploy.
Acceptance criteria
- Decision recorded on which of the three controls apply, with the reasoning
-
crossOriginset on the injected script unless there is a stated reason not to - If SRI is adopted, a documented release step keeps the hash current
- If CSP is available on the Mintlify plan,
script-srcrestricted to the known hosts - ANALYTICS.md/AGENTS.md note the control that ended up in place
Refs #2250, #2286.
- Lingua principale
- MDX
- Stelle
- 90
- Fork
- 398
- Merge medio
- 4g 22h
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di celo-org/docs
-
documentation
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 4 giorni
-
Document Forno's eth_getLogs 5,000-block limit and how to read longer historyForse già presa @szapelao l’ha presa 6 giorni fa. Apertachore priority:medium status: triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
celo-org/docs#2458 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 85/100
I maintainer di solito rispondono entro 4 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 4 giorni
-
chore priority:medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
celo-org/docs#2362 · 1 commento ·
I maintainer di solito rispondono entro 4 giorni
Tutte le issue di celo-org/docs
Issue simili
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
githubnext/gh-aw-workshop#6332 ·
I maintainer di solito rispondono entro 1 giorno
-
docs: powerpc not supportedAperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 1-3 ore Idoneità per principianti 68/100
Revivedx/SavageWindRecomp#1358 ·
I maintainer di solito rispondono entro 2 giorni
-
link-check link-check:manual
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
scylladb/scylladb-docs-homepage#333 ·
I maintainer di solito rispondono entro 1 giorno