Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Patch the hole
Thanks to @SOF3 for finding this vulnerability! Co-Authored-By: Jonathan Chan Kwan Yin <sofe2038@gmail.com>
- Loading branch information
Showing
1 changed file
with
4 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -122,6 +122,10 @@ private function getBasicForm(Player $sender): void { | |
| if ($result === null) { | ||
| return; | ||
| } | ||
| if (!preg_match('/^[\w]+$/', $result[2])) { | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
NhanAZ
Author
Contributor
|
||
| $sender->sendMessage(TextFormat::RED . "Invalid region name! Only alphanumeric characters allowed."); | ||
| return; | ||
| } | ||
| if ($result[2] != null and $result[3] != null) { | ||
| $this->getVectorAdjust()->setLocation($sender, $result[2], $result[3], [$X1, $Y1, $Z1], [$X2, $Y2, $Z2]); | ||
| } else { | ||
|
|
||
I think the best solution is to not use user-provided strings in filenames at all. Why not just store all data in a SQLite3 database?