File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -117,13 +117,16 @@ macro_rules! define_get_static_aliases {
117
117
// We need to move this from being scoped to the app to being scoped for `.perseus/`
118
118
// TODO make sure this works properly on Windows
119
119
let resource = if resource. starts_with( "/" ) {
120
- // Absolute paths should be left as is
121
- resource
120
+ // Absolute paths are a security risk and are disallowed
121
+ panic!( "it's a security risk to include absolute paths in `static_aliases`" ) ;
122
+ } else if resource. starts_with( "../" ) {
123
+ // Anything outside this directory is a security risk as well
124
+ panic!( "it's a security risk to include paths outside the current directory in `static_aliases`" ) ;
122
125
} else if resource. starts_with( "./" ) {
123
- // `./` -> `../`
126
+ // `./` -> `../` (moving to execution from `.perseus/`)
124
127
format!( ".{}" , resource)
125
128
} else {
126
- // Anything else (including `../`) gets a `../` prepended
129
+ // Anything else gets a `../` prepended
127
130
format!( "../{}" , resource)
128
131
} ;
129
132
static_aliases. insert( $url. to_string( ) , resource) ;
You can’t perform that action at this time.
0 commit comments