Opt-out for the module-load eval probe (strict CSP reports a violation on import)
I maintainer di solito rispondono entro 2 giorni
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 70/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- javascript, typescript
- Ambito
- developer-experience, security
Direzione di ricerca
Inizia da packages/typegpu/src/data/compiledIO.ts, dove vive il probe EVAL_ALLOWED_IN_ENV al caricamento del modulo. Leggi i tre design di opt-out suggeriti nell'issue e controlla come typegpu gestisce già le opzioni root/init per scegliere quella adatta. È fatto quando: importare typegpu sotto script-src 'self' non produce alcun report securitypolicyviolation, e il plain writer continua a essere usato con il suo avviso esistente quando eval non è disponibile.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
packages/typegpu/src/data/compiledIO.ts probes for eval support when the module loads:
export const EVAL_ALLOWED_IN_ENV: boolean = (() => {
try {
new Function('return true');
return true;
} catch {
return false;
}
})();
Under a strict Content Security Policy without 'unsafe-eval', the try/catch keeps this from breaking anything: typegpu falls back to the plain writer, and since #2758/#2771 it warns once. But the browser still files a securitypolicyviolation (script-src, eval) the moment typegpu is imported, before any buffer is written.
Hosts that embed apps in sandboxed iframes with a strict CSP (MCP Apps / ChatGPT apps, browser extensions, enterprise pages with CSP reporting) treat any such report as a policy failure. An app that never wants compiled writers can't avoid the report today short of patching the package.
Request
An opt-out that skips the probe, so the plain writer is used without ever calling new Function. Any of these would work for us:
- a global flag read before the probe, like zod's
globalThis.__zod_globalConfig = { jitless: true }; - a lazy probe that runs only the first time a compiled writer is actually requested, plus a root or
initoption to disable compiled writers; - a build-time define (
TYPEGPU_NO_EVAL) that tree-shakes the probe.
Repro
- Serve a page with
Content-Security-Policy: script-src 'self'. - Add
document.addEventListener('securitypolicyviolation', e => console.log(e.violatedDirective, e.blockedURI)). - Import
typegpu. Onescript-src/evalviolation is logged at import, with no GPU work done.
Seen on typegpu 0.12.8. We currently carry a patch-package-style patch that hard-codes the plain writer and would drop it as soon as an opt-out exists. Thanks for TypeGPU!
- Lingua principale
- TypeScript
- Stelle
- 3.3k
- Fork
- 141
- Merge medio
- 3g 8h
- PR unite (30g)
- 72
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun 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 software-mansion/TypeGPU
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
software-mansion/TypeGPU#3219 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
texture.write(VideoFrame) uses the padded coded size instead of the visible sizeForse già presa @RaphaelFakhri l’ha presa 9 giorni fa. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
software-mansion/TypeGPU#3213 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
software-mansion/TypeGPU#3008 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
software-mansion/TypeGPU#2948 · 2 commenti ·
I maintainer di solito rispondono entro 2 giorni
-
docs: Fix camera orientation in "Monocular Light Injection" exampleForse di nuovo libera Una pull request per questa issue è stata chiusa senza essere unita. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
software-mansion/TypeGPU#2890 · 1 commento ·
I maintainer di solito rispondono entro 2 giorni
Tutte le issue di software-mansion/TypeGPU
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
lichess-org/lila#22324 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
[Feature Request] [Web] Expose kvCacheQuantizationBits in the onnxruntime-web WebGPU EP optionsApertaep:WebGPU platform:web quantization
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
microsoft/onnxruntime#33752 ·
I maintainer di solito rispondono entro 2 giorni
-
[Skill Bug]: entra-agent-id: inaccurate blueprint permission inheritance and parent token sub claimApertabug entra-agent-id
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
microsoft/GitHub-Copilot-for-Azure#3467 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
fix(worker): keep normal prepare waiting states failure-freeForse già presa @LichKing-2234 l’ha presa oggi. Apertaagent:codex priority:P1
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
AgoraIO-Extensions/agent-infra#3745 ·
I maintainer di solito rispondono entro 1 giorno
-
The five-line work window can drop its oldest line: the per-line byte share ignores the JSON framingForse già presa @Eapp1e l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
makecindy/cindy#7973 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno