You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#275 put 1 of the 6 webview documents in componentBrowserProvider.ts under a Content-Security-Policy — deliberately the loading spinner, as the smallest and lowest-risk surface: no scripts, no remote data. The other five are the ones a CSP would actually protect:
They emit inline <script> blocks and interpolate component names, descriptions and tag lists fetched from GitLab, including through the client-side markdown renderer. #238 is open against exactly that surface — parameter descriptions and notes rendered unescaped — and a CSP is the layer that would contain it rather than relying on every interpolation site escaping correctly.
convert inline event handlers to delegated listeners. A nonce CSP blocks onclick= and friends; there are 33 inline handlers across the five.
emit the CSP meta tag and load the script via assetUri + the nonce, as getLoadingHtml now does for its stylesheet.
Likely one PR per document rather than one for all five, given the handler rewrite each needs.
Depends on
The helper follow-ups from #275 should land first — #284 (unit-testable helper), #286 (assetUri guard) and #285 (nonce bias). These documents are the call sites that make them load-bearing.
Follow-up from #275.
Problem
#275 put 1 of the 6 webview documents in
componentBrowserProvider.tsunder a Content-Security-Policy — deliberately the loading spinner, as the smallest and lowest-risk surface: no scripts, no remote data. The other five are the ones a CSP would actually protect:getNoSourcesHtml—componentBrowserProvider.ts:311getErrorsHtml—componentBrowserProvider.ts:317getComponentBrowserHtml—componentBrowserProvider.ts:339getErrorHtml—componentBrowserProvider.ts:343getComponentDetailsHtml—componentBrowserProvider.ts:492They emit inline
<script>blocks and interpolate component names, descriptions and tag lists fetched from GitLab, including through the client-side markdown renderer. #238 is open against exactly that surface — parameter descriptions and notes rendered unescaped — and a CSP is the layer that would contain it rather than relying on every interpolation site escaping correctly.Scope
For each document:
<script>intosrc/webview/client/. The esbuild config from refactor(webview): serve loading-view CSS from linted external file under CSP #275 already discovers that directory and emits toout/webview/client/, so no build change is needed.onclick=and friends; there are 33 inline handlers across the five.assetUri+ the nonce, asgetLoadingHtmlnow does for its stylesheet.Likely one PR per document rather than one for all five, given the handler rewrite each needs.
Depends on
The helper follow-ups from #275 should land first — #284 (unit-testable helper), #286 (
assetUriguard) and #285 (nonce bias). These documents are the call sites that make them load-bearing.