File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,13 @@ export async function processImage(
6767 const stats = fs . statSync ( filePath ) ;
6868 const ext = path . extname ( filePath ) . toLowerCase ( ) ;
6969
70- const resolvedPath = path . resolve ( filePath ) ;
71- const normalizedCwd = path . resolve ( cwd ) ;
72- if ( ! resolvedPath . startsWith ( normalizedCwd ) ) {
73- throw new Error ( 'Invalid file path: path traversal detected' ) ;
74- }
70+ // Why? The image directory validation was originally placed outside for agent-browser.
71+ // The check has been temporarily removed for adjustment.
72+ // const resolvedPath = path.resolve(filePath);
73+ // const normalizedCwd = path.resolve(cwd);
74+ // if (!resolvedPath.startsWith(normalizedCwd)) {
75+ // throw new Error('Invalid file path: path traversal detected');
76+ // }
7577
7678 const buffer = fs . readFileSync ( filePath ) ;
7779
You can’t perform that action at this time.
0 commit comments