From 8231da0b8dca4b5ef2c62ef6b6d16b21d18fe0f2 Mon Sep 17 00:00:00 2001 From: Alex Martens Date: Sat, 20 Jul 2024 13:43:38 -0700 Subject: [PATCH] nixos/tests: test correct page with invalid path --- nixos/tests/basic.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/nixos/tests/basic.nix b/nixos/tests/basic.nix index a270d67..c1ade25 100644 --- a/nixos/tests/basic.nix +++ b/nixos/tests/basic.nix @@ -350,6 +350,11 @@ in 'curl -sS -b pages_cookies.txt -o /dev/null -w "%{http_code}" ${oidcPagesFrontendUrl}/p/top_secret/index.html | grep -q "^404$"', ) + # check that a correct page with invalid path results in a 404 + machine.succeed( + 'curl -sS -b pages_cookies.txt -o /dev/null -w "%{http_code}" ${oidcPagesFrontendUrl}/p/notes/not_a_real_page.html | grep -q "^404$"', + ) + # basic directory traversal attack check machine.succeed( 'curl -sS -b pages_cookies.txt -o /dev/null -w "%{http_code}" ${oidcPagesFrontendUrl}/p/notes/../../top_secret/index.html | grep -q "^404$"',