Skip to content

Conversation

daxian-dbw
Copy link
Member

PR Summary

A malicious actor could add the 'execute' permission to the configuration file on Linux and macOS. Since we depend on shell execute to open the configuration file in the default text editor on the system, this could cause the file to be executed if the content gets set to be shell script.

To guard against this, we detect if the configuration file has 'execute' permission set, and if so we try to remove the 'execute' permission. If we fail to remove due to lack of access level, we write out an error about it and return.

@daxian-dbw daxian-dbw requested a review from Copilot December 6, 2024 19:49
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot reviewed 1 out of 1 changed files in this pull request and generated no suggestions.

@daxian-dbw daxian-dbw merged commit 2aefb25 into PowerShell:main Dec 6, 2024
4 checks passed
@daxian-dbw daxian-dbw deleted the unix branch December 6, 2024 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant