@@ -25,6 +25,8 @@ <h2>Unsafe Fetch</h2>
2525< pre class ="unsafe-fetch-8498-2 "> </ pre >
2626< pre class ="unsafe-fetch-import-inline-status "> </ pre >
2727< pre class ="unsafe-fetch-raw-query-import-status "> </ pre >
28+ < pre class ="unsafe-fetch-query-dot-svg-import-status "> </ pre >
29+ < pre class ="unsafe-fetch-svg-status "> </ pre >
2830
2931< h2 > Safe /@fs/ Fetch</ h2 >
3032< pre class ="safe-fs-fetch-status "> </ pre >
@@ -49,13 +51,15 @@ <h2>Unsafe /@fs/ Fetch</h2>
4951< pre class ="unsafe-fs-fetch-8498-2 "> </ pre >
5052< pre class ="unsafe-fs-fetch-import-inline-status "> </ pre >
5153< pre class ="unsafe-fs-fetch-import-inline-wasm-init-status "> </ pre >
54+ < pre class ="unsafe-fs-fetch-relative-path-after-query-status "> </ pre >
5255
5356< h2 > Nested Entry</ h2 >
5457< pre class ="nested-entry "> </ pre >
5558
5659< h2 > Denied</ h2 >
5760< pre class ="unsafe-dotenv "> </ pre >
5861< pre class ="unsafe-dotEnV-casing "> </ pre >
62+ < pre class ="unsafe-dotenv-query-dot-svg-wasm-init "> </ pre >
5963
6064< script type ="module ">
6165 import '../../entry'
@@ -182,6 +186,24 @@ <h2>Denied</h2>
182186 console . error ( e )
183187 } )
184188
189+ // outside of allowed dir with .svg query import
190+ fetch ( joinUrlSegments ( base , '/unsafe.txt?.svg?import' ) )
191+ . then ( ( r ) => {
192+ text ( '.unsafe-fetch-query-dot-svg-import-status' , r . status )
193+ } )
194+ . catch ( ( e ) => {
195+ console . error ( e )
196+ } )
197+
198+ // svg outside of allowed dir, treated as unsafe
199+ fetch ( joinUrlSegments ( base , '/unsafe.svg?import' ) )
200+ . then ( ( r ) => {
201+ text ( '.unsafe-fetch-svg-status' , r . status )
202+ } )
203+ . catch ( ( e ) => {
204+ console . error ( e )
205+ } )
206+
185207 // imported before, should be treated as safe
186208 fetch ( joinUrlSegments ( base , joinUrlSegments ( '/@fs/' , ROOT ) + '/safe.json' ) )
187209 . then ( ( r ) => {
@@ -298,6 +320,21 @@ <h2>Denied</h2>
298320 console . error ( e )
299321 } )
300322
323+ // outside of root with relative path after query
324+ fetch (
325+ joinUrlSegments (
326+ base ,
327+ joinUrlSegments ( '/@fs/' , ROOT ) +
328+ '/root/src/?/../../unsafe.txt?import&raw' ,
329+ ) ,
330+ )
331+ . then ( ( r ) => {
332+ text ( '.unsafe-fs-fetch-relative-path-after-query-status' , r . status )
333+ } )
334+ . catch ( ( e ) => {
335+ console . error ( e )
336+ } )
337+
301338 // outside root with special characters #8498
302339 fetch (
303340 joinUrlSegments (
@@ -368,6 +405,20 @@ <h2>Denied</h2>
368405 console . error ( e )
369406 } )
370407
408+ // .env with .svg?.wasm?init
409+ fetch (
410+ joinUrlSegments (
411+ base ,
412+ joinUrlSegments ( '/@fs/' , ROOT ) + '/root/src/.env?.svg?.wasm?init' ,
413+ ) ,
414+ )
415+ . then ( ( r ) => {
416+ text ( '.unsafe-dotenv-query-dot-svg-wasm-init' , r . status )
417+ } )
418+ . catch ( ( e ) => {
419+ console . error ( e )
420+ } )
421+
371422 function text ( sel , text ) {
372423 document . querySelector ( sel ) . textContent = text
373424 }
0 commit comments