diff --git a/interface/web/capp.php b/interface/web/capp.php
index 2c143180f0cb24f459c53757af4f5a158a3346cd..b0568ba09dad0000f5e6c77f3b3a0de2027b740d 100644
--- a/interface/web/capp.php
+++ b/interface/web/capp.php
@@ -43,6 +43,7 @@ if($_SESSION["s"]["user"]['active'] != 1) {
 }
 
 if(!preg_match("/^[a-z]{2,20}$/i", $mod)) die('module name contains unallowed chars.');
+if($redirect != '' && !preg_match("/^[a-z0-9]+\/[a-z0-9_\.\-]+\?id=[0-9]{1,5}$/i", $redirect)) die('redirect contains unallowed chars.');
 
 //* Check if user may use the module.
 $user_modules = explode(",", $_SESSION["s"]["user"]["modules"]);