Fix command injection in newname, shiftfile, and sendtest#629
Open
twinvega wants to merge 1 commit into
Open
Conversation
…lete Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Author
|
This assumes a user that has not changed the default authentication for the WebUI. |
6 tasks
|
same conclusion with some add |
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.
Fix command injection in
newname,shiftfile, andsendtestThree files had user-controlled values passed unescaped into shell commands. All require authentication to reach. None of these are addressed by PR #575.
1.
play.php—newnameparameter (command injection) ✓ confirmedVulnerable code:
$newnameisurldecode($_GET['newname'])with no shell escaping.FILTER_SANITIZE_STRINGencodes"to", preventing direct quote breakout — but$()command substitution executes inside double-quoted bash strings and passes through the filter unchanged.Request:
Response:
2.
play.php—shiftfile→$dirinmkdir(command injection) ✓ confirmedVulnerable code:
$diris unquoted in themkdircall. A;after a valid path segment executes a second command. Output is blind so a file write confirms execution.Request:
Response:
Verify: SSH into the host and check that
/tmp/this_is_vulnerableexists.3.
config.php—apprise_notification_titleinsendtest(argument injection) ✓ confirmedVulnerable code:
escapeshellcmd()does not escape paired single quotes. Injecting' --config <file> --title 'overrides the Apprise config path with any file on disk. Apprise attempts to parse it as a notification config and echoes the first non-comment line in the error output — fully in-band, no external service required.Request:
Response:
Fix
Replace string interpolation with
escapeshellarg()in all three locations. 3 lines changed across 2 files.