Repository navigation
Only allow scripting terminal changes on the terminal's own disks (1.20) - #105
Merged
Merged
Conversation
The script modify, delete and create packets carry a disk id from the client, and the server applied them to that disk without checking that the disk is part of the terminal's network. The server now ignores disks that are not in the terminal's available disks. Fixes GHSA-mpph-9cpc-3hfq Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UeSuG5REz2JxHTZADcGhh2
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.
Fixes GHSA-mpph-9cpc-3hfq for master-1.20-lts.
The scripting terminal packets (modify, delete and create script) carry a disk id from the client. The server applied them to that disk after only checking that the player has some scripting terminal open, so a player could change or delete scripts on disks of other networks.
ContainerTerminalScripting.setServerScriptandcreateNewServerScriptnow ignore disks that are not in the terminal's available disks. Script paths were already validated byScriptingData.isScriptPathSafe.master-1.21-lts also has a rename packet that needs the same check. It is fixed in #106 against master-1.21-lts, because that code does not exist on this branch. When upmerging this PR into master-1.21-lts after #106 is merged, keep the 1.21 version of
ContainerTerminalScripting.Testing
./gradlew buildpasses on master-1.20-lts, including the 60 existing unit tests. This branch has no game tests. The 1.21 PR adds a game test for the same check.🤖 Generated with Claude Code
https://claude.ai/code/session_01UeSuG5REz2JxHTZADcGhh2