Require authorization for mod-supplied external commands - #368
Draft
4Luke4 wants to merge 2 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
EXACTand non-EXACTbehavior.strace, command allowlist, or additional sandbox utility.This partially addresses the external-command execution concerns discussed in #313 without imposing a single game-directory boundary or introducing additional runtime dependencies.
Authorization behavior
Y <token>authorizes one command.A <token>authorizes commands only for the same TP2 and component.--ask-external-commands--allow-external-commands--deny-external-commands--allow-external-commandsgrants invocation-wide authorization.--yesdoes not authorize external commands.Denial and uninstall safety
External-command denial is represented as a dedicated fatal security decision. It cannot be caught or downgraded by:
ACTION_TRYACTION_IF--continueDuring uninstall, an error or denial in an
AThook does not prevent WeiDU from attempting the remainingCOPY,MOVE, andSTRSETrestoration categories.After restoration:
WeiDU.logreflects the restored component state.Security scope
This is an authorization boundary, not an operating-system sandbox.
Authorized commands retain the user’s operating-system permissions and are not restricted to the game directory. WeiDU’s built-in file operations and other authority surfaces remain outside this PR’s scope.
Accordingly, this PR partially addresses #313 and is not intended to close the entire issue.
Validation
Local verification against the current head (
db45223) includes:--yesisolationACTION_TRY--continueACTION_IFACTION_TRYCOPY,MOVE, andSTRSETrestorationWeiDU.logstate after denied uninstall hooksEXACTcommandsa88b69b)git diff --checkThe policy suite is wired into the repository’s Linux, macOS, and Windows jobs, and the main workflow now runs for pull requests. The current GitHub-hosted runs require upstream-maintainer approval before their jobs can execute.