Skip to content

[dev-tool] Customization apply command could be dangerous #37307

@timovv

Description

@timovv

apply can delete the entire package directory if --targetDirectory is set to . (or otherwise resolves to the project root). Since the command does fs.rm(customizedDirectory, { recursive: true }), it would wipe the repo contents and then copy the merge result back. Please add validation to reject target directories that resolve to the project root (or are empty), and also ensure sourceDirectory and targetDirectory are distinct/non-overlapping paths before proceeding.

Originally posted by @Copilot in #37306 (comment)

Metadata

Metadata

Assignees

Labels

dev-toolIssues related to the Azure SDK for JS dev-tool

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions