Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

test: add coverage for newline and tab rejection in volume strings

Andras Bacsai8b20b0e45a7d
diff --git a/tests/Unit/VolumeSecurityTest.php b/tests/Unit/VolumeSecurityTest.php
index 0196000a3f..d7f20fc0ec 100644
--- a/tests/Unit/VolumeSecurityTest.php
+++ b/tests/Unit/VolumeSecurityTest.php
@@ -174,3 +174,13 @@ test('parseDockerVolumeString rejects redirection operators', function () {
->toThrow(Exception::class);
}
});
+
+test('parseDockerVolumeString rejects newline and tab in volume strings', function () {
+ // Newline can be used as command separator
+ expect(fn () => parseDockerVolumeString("/data\n:/app"))
+ ->toThrow(Exception::class);
+
+ // Tab can be used as token separator
+ expect(fn () => parseDockerVolumeString("/data\t:/app"))
+ ->toThrow(Exception::class);
+});