Skip to content

Commit 358e935

Browse files
committed
add test for path traversal
1 parent e29230f commit 358e935

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ jobs:
109109
- "8.2"
110110
- "8.3"
111111
- "8.4"
112+
- "8.5"
112113
dependencies:
113114
- lowest
114115
- highest

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@
6363
"monolog/monolog": "^1.3 || ^2.0",
6464
"phpunit/phpunit": "^9.0 | 8.5.22",
6565
"cache/array-adapter": "^1.0",
66-
"symplify/easy-coding-standard": "12.5.8",
66+
"symplify/easy-coding-standard": "12.6.2",
6767
"phpstan/phpstan": "^2.1.6"
6868
},
6969
"config": {

test/unit/MiscTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
use Commercetools\Api\Models\Type\TypeReferenceBuilder;
3838
use Commercetools\Api\Models\Type\TypeResourceIdentifierBuilder;
3939
use Commercetools\Base\JsonObject;
40+
use Commercetools\Client\ApiRequest;
4041
use Commercetools\Client\ClientCredentials;
4142
use Commercetools\Client\ClientFactory;
4243
use GuzzleHttp\Psr7\Response;
@@ -297,4 +298,11 @@ public function testCredentials()
297298
$credentials = new ClientCredentials("clientId", "clientSecret");
298299
$this->assertInstanceOf(ClientCredentials::class, $credentials);
299300
}
301+
302+
public function testPathTraversal()
303+
{
304+
$b = new ApiRequestBuilder();
305+
$request = $b->withProjectKey('test')->carts()->withId("../categories")->get();
306+
$this->assertSame("test/carts/..%2Fcategories", $request->getUri()->getPath());
307+
}
300308
}

0 commit comments

Comments
 (0)