File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -25,17 +25,6 @@ function validateModuleName(name) {
2525 return name ;
2626}
2727
28- function securePathJoin ( ...paths ) {
29- // Prevent path traversal by normalizing and validating the resulting path
30- const result = path . normalize ( path . join ( ...paths ) ) ;
31- const basePath = path . normalize ( paths [ 0 ] ) ;
32-
33- if ( ! result . startsWith ( basePath ) ) {
34- throw new Error ( `Path traversal detected: ${ result } is outside of ${ basePath } ` ) ;
35- }
36- return result ;
37- }
38-
3928function calculateFileHash ( filePath ) {
4029 return new Promise ( ( resolve , reject ) => {
4130 const hash = crypto . createHash ( 'sha256' ) ;
@@ -68,10 +57,9 @@ async function run() {
6857 throw new Error ( `Module path does not exist: ${ modulePath } ` ) ;
6958 }
7059
71- // Parse Google credentials
72- let credentials ;
60+ // Parse Google credentials to validate JSON format
7361 try {
74- credentials = JSON . parse ( googleCredentialsJson ) ;
62+ JSON . parse ( googleCredentialsJson ) ;
7563 } catch ( error ) {
7664 throw new Error ( `Failed to parse Google credentials: ${ error . message } ` ) ;
7765 }
You can’t perform that action at this time.
0 commit comments