Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check and remove execute permission from the config file #317

Merged
merged 1 commit into from
Dec 6, 2024

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

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