Skip to content

Commit e4c215b

Browse files
fix: prevent arbitrary code execution from node_modules directory
Before this patch any JavaScript files matching the globs: `**/*.plugins.{js,mjs}`, `**/*.plugin.{js,mjs}`, or `**/*.slyde.{js,mjs}` would be imported automatically. Which includes the `node_modules` folder. Which means that any malicious package with a `*.slyde.js` file could have arbitrary code execution by being installed and have the user run slyde in a parent directory.
1 parent ede4208 commit e4c215b

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

src/commands/base.ts

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,7 @@ export const cli = yargs(hideBin(process.argv))
3838
alias: 'p',
3939
array: true,
4040
coerce: (value: readonly string[]) => FastGlob.sync([...value]),
41-
default: [
42-
'plugins/**.{js,mjs}',
43-
'slyde/**.{js,mjs}',
44-
'**/*.plugins.{js,mjs}',
45-
'**/*.plugin.{js,mjs}',
46-
'**/*.slyde.{js,mjs}',
47-
] as string[],
41+
default: ['plugins/**.slyde.{js,mjs}'] as string[],
4842
description: 'A directory or file to import and use as custom tags',
4943
type: 'string',
5044
})

0 commit comments

Comments
 (0)