Skip to content

Commit 4d3563b

Browse files
Merge branch 'develop' into showunlimited
2 parents 917a1e8 + 0795f87 commit 4d3563b

File tree

7 files changed

+54
-54
lines changed

7 files changed

+54
-54
lines changed

SECURITY.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
The following versions of Pterodactyl are receiving active support and maintenance. Any security vulnerabilities discovered must be reproducible in supported versions.
5+
6+
| Panel | Daemon | Supported |
7+
| ----- | ------------ | ------------------ |
8+
| 1.0.x | wings@1.0.x | :white_check_mark: |
9+
| 0.7.x | daemon@0.6.x | :white_check_mark: |
10+
| 0.6.x | daemon@0.5.x | :x: |
11+
| 0.5.x | daemon@0.4.x | :x: |
12+
13+
## Reporting a Vulnerability
14+
15+
Please reach out directly to any project team member on Discord when reporting a security vulnerability, or you can send an email to `dane [ät] pterodactyl.io`.
16+
17+
We make every effort to respond as soon as possible, although it may take a day or two for us to sync internally and determine the severity of the report and its impact. Please, _do not_ use a public facing channel or GitHub issues to report sensitive security issues.
18+
19+
As part of our process, we will create a security advisory for the affected versions and disclose it publicly, usually two to four weeks after a releasing a version that addresses it.

app/Http/Controllers/Admin/ServersController.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ public function newDatabase(StoreServerDatabaseRequest $request, $server)
323323
'database' => $request->input('database'),
324324
'remote' => $request->input('remote'),
325325
'database_host_id' => $request->input('database_host_id'),
326+
'max_connections' => $request->input('max_connections'),
326327
]);
327328

328329
return redirect()->route('admin.servers.view.database', $server)->withInput();

app/Repositories/Wings/DaemonFileRepository.php

Lines changed: 5 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,13 @@
22

33
namespace Pterodactyl\Repositories\Wings;
44

5-
use stdClass;
6-
use Exception;
75
use Webmozart\Assert\Assert;
86
use Pterodactyl\Models\Server;
97
use Psr\Http\Message\ResponseInterface;
108
use Pterodactyl\Exceptions\Http\Server\FileSizeTooLargeException;
119

1210
class DaemonFileRepository extends DaemonRepository
1311
{
14-
/**
15-
* Return stat information for a given file.
16-
*
17-
* @param string $path
18-
* @return \stdClass
19-
*
20-
* @throws \Exception
21-
* @throws \GuzzleHttp\Exception\TransferException
22-
*/
23-
public function getFileStat(string $path): stdClass
24-
{
25-
throw new Exception('Function not implemented.');
26-
}
27-
2812
/**
2913
* Return the contents of a given file.
3014
*
@@ -55,29 +39,6 @@ public function getContent(string $path, int $notLargerThan = null): string
5539
return $response->getBody()->__toString();
5640
}
5741

58-
/**
59-
* Returns a stream of a file's contents back to the calling function to allow
60-
* proxying the request through the Panel rather than needing a direct call to
61-
* the Daemon in order to work.
62-
*
63-
* @param string $path
64-
* @return \Psr\Http\Message\ResponseInterface
65-
*/
66-
public function streamContent(string $path): ResponseInterface
67-
{
68-
Assert::isInstanceOf($this->server, Server::class);
69-
70-
$response = $this->getHttpClient()->get(
71-
sprintf('/api/servers/%s/files/contents', $this->server->uuid),
72-
[
73-
'query' => ['file' => $path, 'download' => true],
74-
'stream' => true,
75-
]
76-
);
77-
78-
return $response;
79-
}
80-
8142
/**
8243
* Save new contents to a given file. This works for both creating and updating
8344
* a file.
@@ -138,8 +99,8 @@ public function createDirectory(string $name, string $path): ResponseInterface
13899
sprintf('/api/servers/%s/files/create-directory', $this->server->uuid),
139100
[
140101
'json' => [
141-
'name' => $name,
142-
'path' => $path,
102+
'name' => urldecode($name),
103+
'path' => urldecode($path),
143104
],
144105
]
145106
);
@@ -160,8 +121,8 @@ public function renameFile(string $from, string $to): ResponseInterface
160121
sprintf('/api/servers/%s/files/rename', $this->server->uuid),
161122
[
162123
'json' => [
163-
'rename_from' => $from,
164-
'rename_to' => $to,
124+
'rename_from' => urldecode($from),
125+
'rename_to' => urldecode($to),
165126
],
166127
]
167128
);
@@ -181,7 +142,7 @@ public function copyFile(string $location): ResponseInterface
181142
sprintf('/api/servers/%s/files/copy', $this->server->uuid),
182143
[
183144
'json' => [
184-
'location' => $location,
145+
'location' => urldecode($location),
185146
],
186147
]
187148
);

database/seeds/eggs/minecraft/egg-forge-minecraft.json

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"meta": {
44
"version": "PTDL_v1"
55
},
6-
"exported_at": "2019-02-10T22:57:27+01:00",
6+
"exported_at": "2020-05-24T12:15:13-04:00",
77
"name": "Forge Minecraft",
88
"author": "support@pterodactyl.io",
99
"description": "Minecraft Forge Server. Minecraft Forge is a modding API (Application Programming Interface), which makes it easier to create mods, and also make sure mods are compatible with each other.",
@@ -17,8 +17,8 @@
1717
},
1818
"scripts": {
1919
"installation": {
20-
"script": "#!\/bin\/bash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y curl\r\n\r\n#Fetching version\r\nif [ -z \"$MC_VERSION\" ] || [ \"$MC_VERSION\" == \"latest\" ]; then\r\n echo \"Fetching latest\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1].[0-9]*.[0-9]* - [0-9]*.[0-9]*.[0-9]*.[0-9]*' | sed 's\/ \/\/g')\r\nelif [[ ! \"$MC_VERSION\" =~ - ]]; then\r\n echo \"Fetching latest from version $MC_VERSION\"\r\n MC_VERSION=$(curl -sl https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/index_$MC_VERSION.html | grep -A 2 \"Latest\" | awk NF=NF RS= OFS=\" \" | grep -o -e '[1].[0-9]*.[0-9]* - [0-9]*.[0-9]*.[0-9]*.[0-9]*' | sed 's\/ \/\/g')\r\nfi\r\n\r\n#Checking if forge version valid\r\nif [[ ! \"$MC_VERSION\" =~ [1].[0-9]*.[0-9]*-[0-9]*.[0-9]*.[0-9]*.[0-9]* ]]; then\r\n echo \"!!! Invalid forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Go into main direction\r\ncd \/mnt\/server\r\n\r\n#Adding .jar when not eding by SERVER_JARFILE\r\nif [[ ! $SERVER_JARFILE = *\\.jar ]]; then\r\n SERVER_JARFILE=\"$SERVER_JARFILE.jar\"\r\nfi\r\n\r\n#Downloading jars\r\necho -e \"Downloading forge version \\\"$MC_VERSION\\\"\"\r\ncurl -o installer.jar -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-installer.jar\r\ncurl -o $SERVER_JARFILE -sS https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/$MC_VERSION\/forge-$MC_VERSION-universal.jar\r\n\r\n#Checking if downloaded jars exist\r\nif [ ! -f .\/installer.jar ] || [ ! -f .\/$SERVER_JARFILE ]; then\r\n echo \"!!! Error by downloading forge version \\\"$MC_VERSION\\\" !!!\"\r\n exit\r\nfi\r\n\r\n#Installing server\r\necho -e \"Installing forge server.\\n\"\r\njava -jar installer.jar --installServer\r\n\r\n#Deleting installer.jar\r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar",
21-
"container": "openjdk:8",
20+
"script": "#!\/bin\/bash\r\n# Forge Installation Script\r\n#\r\n# Server Files: \/mnt\/server\r\napt update\r\napt install -y curl jq\r\n\r\n#Go into main direction\r\nif [ ! -d \/mnt\/server ]; then\r\n mkdir \/mnt\/server\r\nfi\r\n\r\ncd \/mnt\/server\r\n\r\nif [ ! -z ${FORGE_VERSION} ]; then\r\n DOWNLOAD_LINK=https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/${FORGE_VERSION}\/forge-${FORGE_VERSION}\r\nelse\r\n JSON_DATA=$(curl -sSL https:\/\/files.minecraftforge.net\/maven\/net\/minecraftforge\/forge\/promotions_slim.json)\r\n\r\n if [ \"${MC_VERSION}\" == \"latest\" ] || [ \"${MC_VERSION}\" == \"\" ] ; then\r\n echo -e \"getting latest recommended version of forge.\"\r\n MC_VERSION=$(echo -e ${JSON_DATA} | jq -r '.promos | del(.\"latest-1.7.10\") | del(.\"1.7.10-latest-1.7.10\") | to_entries[] | .key | select(contains(\"recommended\")) | split(\"-\")[0]' | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n | tail -1)\r\n \tBUILD_TYPE=recommended\r\n fi\r\n\r\n if [ \"${BUILD_TYPE}\" != \"recommended\" ] && [ \"${BUILD_TYPE}\" != \"latest\" ]; then\r\n BUILD_TYPE=recommended\r\n fi\r\n\r\n echo -e \"minecraft version: ${MC_VERSION}\"\r\n echo -e \"build type: ${BUILD_TYPE}\"\r\n\r\n ## some variables for getting versions and things\r\n FILE_SITE=$(echo -e ${JSON_DATA} | jq -r '.homepage' | sed \"s\/http:\/https:\/g\")\r\n VERSION_KEY=$(echo -e ${JSON_DATA} | jq -r --arg MC_VERSION \"${MC_VERSION}\" --arg BUILD_TYPE \"${BUILD_TYPE}\" '.promos | del(.\"latest-1.7.10\") | del(.\"1.7.10-latest-1.7.10\") | to_entries[] | .key | select(contains($MC_VERSION)) | select(contains($BUILD_TYPE))')\r\n\r\n ## locating the forge version\r\n if [ \"${VERSION_KEY}\" == \"\" ] && [ \"${BUILD_TYPE}\" == \"recommended\" ]; then\r\n echo -e \"dropping back to latest from recommended due to there not being a recommended version of forge for the mc version requested.\"\r\n VERSION_KEY=$(echo -e ${JSON_DATA} | jq -r --arg MC_VERSION \"${MC_VERSION}\" '.promos | del(.\"latest-1.7.10\") | del(.\"1.7.10-latest-1.7.10\") | to_entries[] | .key | select(contains($MC_VERSION)) | select(contains(\"recommended\"))')\r\n fi\r\n\r\n ## Error if the mc version set wasn't valid.\r\n if [ \"${VERSION_KEY}\" == \"\" ] || [ \"${VERSION_KEY}\" == \"null\" ]; then\r\n \techo -e \"The install failed because there is no valid version of forge for the version on minecraft selected.\"\r\n \texit 1\r\n fi\r\n\r\n FORGE_VERSION=$(echo -e ${JSON_DATA} | jq -r --arg VERSION_KEY \"$VERSION_KEY\" '.promos | .[$VERSION_KEY]')\r\n\r\n if [ \"${MC_VERSION}\" == \"1.7.10\" ] || [ \"${MC_VERSION}\" == \"1.8.9\" ]; then\r\n DOWNLOAD_LINK=${FILE_SITE}${MC_VERSION}-${FORGE_VERSION}-${MC_VERSION}\/forge-${MC_VERSION}-${FORGE_VERSION}-${MC_VERSION}\r\n FORGE_JAR=forge-${MC_VERSION}-${FORGE_VERSION}-${MC_VERSION}.jar\r\n if [ \"${MC_VERSION}\" == \"1.7.10\" ]; then\r\n FORGE_JAR=forge-${MC_VERSION}-${FORGE_VERSION}-${MC_VERSION}-universal.jar\r\n fi\r\n else\r\n DOWNLOAD_LINK=${FILE_SITE}${MC_VERSION}-${FORGE_VERSION}\/forge-${MC_VERSION}-${FORGE_VERSION}\r\n FORGE_JAR=forge-${MC_VERSION}-${FORGE_VERSION}.jar\r\n fi\r\nfi\r\n\r\n\r\n#Adding .jar when not eding by SERVER_JARFILE\r\nif [[ ! $SERVER_JARFILE = *\\.jar ]]; then\r\n SERVER_JARFILE=\"$SERVER_JARFILE.jar\"\r\nfi\r\n\r\n#Downloading jars\r\necho -e \"Downloading forge version ${FORGE_VERSION}\"\r\nif [ ! -z \"${DOWNLOAD_LINK}\" ]; then \r\n if curl --output \/dev\/null --silent --head --fail ${DOWNLOAD_LINK}-installer.jar; then\r\n echo -e \"installer jar download link is valid.\"\r\n else\r\n echo -e \"link is invalid closing out\"\r\n exit 2\r\n fi\r\n\r\n echo -e \"no download link closing out\"\r\n exit 3\r\nfi\r\n\r\ncurl -s -o installer.jar -sS ${DOWNLOAD_LINK}-installer.jar\r\n\r\n#Checking if downloaded jars exist\r\nif [ ! -f .\/installer.jar ]; then\r\n echo \"!!! Error by downloading forge version ${FORGE_VERSION} !!!\"\r\n exit\r\nfi\r\n\r\n#Installing server\r\necho -e \"Installing forge server.\\n\"\r\njava -jar installer.jar --installServer || { echo -e \"install failed\"; exit 4; }\r\n\r\nmv $FORGE_JAR $SERVER_JARFILE\r\n\r\n#Deleting installer.jar\r\necho -e \"Deleting installer.jar file.\\n\"\r\nrm -rf installer.jar",
21+
"container": "openjdk:8-jdk-slim",
2222
"entrypoint": "bash"
2323
}
2424
},
@@ -34,11 +34,29 @@
3434
},
3535
{
3636
"name": "Forge version",
37-
"description": "The version of forge that you want to run.\r\nExamples:\r\n- 1.12.2\r\n- 1.12.2-14.23.5.2810",
37+
"description": "The version of minecraft you want to install for.\r\n\r\nLeaving latest will install the latest recommended version.",
3838
"env_variable": "MC_VERSION",
3939
"default_value": "latest",
4040
"user_viewable": 1,
4141
"user_editable": 1,
42+
"rules": "required|string|max:9"
43+
},
44+
{
45+
"name": "Build Type",
46+
"description": "The type of server jar to download from forge.\r\n\r\nValid types are \"recommended\" and \"latest\".",
47+
"env_variable": "BUILD_TYPE",
48+
"default_value": "recommended",
49+
"user_viewable": 1,
50+
"user_editable": 1,
51+
"rules": "required|string|max:20"
52+
},
53+
{
54+
"name": "Forge Version",
55+
"description": "Gets an exact version.\r\n\r\nEx. 1.15.2-31.2.4\r\n\r\nOverrides MC_VERSION and BUILD_TYPE. If it fails to download the server files it will fail to install.",
56+
"env_variable": "FORGE_VERSION",
57+
"default_value": "",
58+
"user_viewable": 1,
59+
"user_editable": 1,
4260
"rules": "required|string|max:20"
4361
}
4462
]

resources/scripts/components/server/StatGraphs.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ const chartDefaults: ChartConfiguration = {
1717
enabled: false,
1818
},
1919
animation: {
20-
duration: 250,
20+
duration: 0,
2121
},
2222
elements: {
2323
point: {
2424
radius: 0,
2525
},
2626
line: {
27-
tension: 0.1,
27+
tension: 0.3,
2828
backgroundColor: 'rgba(15, 178, 184, 0.45)',
2929
borderColor: '#32D0D9',
3030
},

resources/scripts/components/server/users/EditSubuserModal.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
5353
const [ canEditUser ] = usePermissions(subuser ? [ 'user.update' ] : [ 'user.create' ]);
5454
const permissions = useStoreState(state => state.permissions.data);
5555

56+
const user = useStoreState(state => state.user.data!);
57+
5658
// The currently logged in user's permissions. We're going to filter out any permissions
5759
// that they should not need.
5860
const loggedInPermissions = ServerContext.useStoreState(state => state.server.permissions);
@@ -64,7 +66,7 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
6466

6567
const list: string[] = ([] as string[]).concat.apply([], Object.values(cleaned));
6668

67-
if (loggedInPermissions.length === 1 && loggedInPermissions[0] === '*') {
69+
if (user.rootAdmin || (loggedInPermissions.length === 1 && loggedInPermissions[0] === '*')) {
6870
return list;
6971
}
7072

@@ -81,12 +83,14 @@ const EditSubuserModal = forwardRef<HTMLHeadingElement, Props>(({ subuser, ...pr
8183
}
8284
</h3>
8385
<FlashMessageRender byKey={'user:edit'} className={'mt-4'}/>
86+
{(!user.rootAdmin && loggedInPermissions[0] !== '*') &&
8487
<div className={'mt-4 pl-4 py-2 border-l-4 border-cyan-400'}>
8588
<p className={'text-sm text-neutral-300'}>
8689
Only permissions which your account is currently assigned may be selected when creating or
8790
modifying other users.
8891
</p>
8992
</div>
93+
}
9094
{!subuser &&
9195
<div className={'mt-6'}>
9296
<Field

routes/api-remote.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
use Illuminate\Support\Facades\Route;
44

5-
Route::get('/authenticate/{token}', 'ValidateKeyController@index');
6-
Route::post('/download-file', 'FileDownloadController@index');
7-
85
// Routes for the Wings daemon.
96
Route::post('/sftp/auth', 'SftpAuthenticationController');
107

0 commit comments

Comments
 (0)