Skip to content
This repository was archived by the owner on Jan 30, 2026. It is now read-only.

Check and remove execute permission from the config file#317

Merged
daxian-dbw merged 1 commit intoPowerShell:mainfrom
daxian-dbw:unix
Dec 6, 2024
Merged

Check and remove execute permission from the config file#317
daxian-dbw merged 1 commit intoPowerShell:mainfrom
daxian-dbw:unix

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 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
@daxian-dbw daxian-dbw deleted the unix branch December 6, 2024 20:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant