mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 07:30:41 +09:00
Merge pull request #1053 from bbassie/fix/instance-save-name-traversal
Check save names in instance start and create save
This commit is contained in:
1 parent
ce6bfe282f
commit
069f537bde
2 files changed
+30
No files matched your search
@@ -223,6 +223,23 @@ describe("class Instance", function() {
|
||||
});
|
||||
});
|
||||
|
||||
describe("save name checks", function() {
|
||||
it("should reject a start save outside the saves directory", async function() {
|
||||
await assert.rejects(
|
||||
instance.handleInstanceStartRequest(new lib.InstanceStartRequest("../escape.zip")),
|
||||
lib.RequestError,
|
||||
);
|
||||
});
|
||||
it("should reject a created save outside the saves directory", async function() {
|
||||
await assert.rejects(
|
||||
instance.handleInstanceCreateSaveRequest(
|
||||
new lib.InstanceCreateSaveRequest("../escape.zip"),
|
||||
),
|
||||
lib.RequestError,
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
describe("._recordPlayerJoin()", function() {
|
||||
it("should add player to playersOnline", function() {
|
||||
instance._recordPlayerJoin("player");
|
||||
|
||||
Reference in new issue
Block a user