From 7395758019b67490c27fb871b6edcfa8e964c91f Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Fri, 10 Oct 2025 11:54:46 +0200 Subject: [PATCH] Bug 40993: Add Apache RewriteRule for hitting value_builder pages Content-Type: text/plain; charset=utf-8 Test plan: Copy this file to /etc/koha. Restart Apache. Login to staff and hit a value builder page directly, e.g.: YOUR_SERVER/cgi-bin/koha/cataloguing/value_builder/marc21_field_005.pl Verify that you got redirected to 403. Verify that you can still edit a biblio record and open e.g. the leader plugin form. Signed-off-by: Marcel de Rooy --- debian/templates/apache-shared-intranet.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/debian/templates/apache-shared-intranet.conf b/debian/templates/apache-shared-intranet.conf index ad00145832..d8ee24e10f 100644 --- a/debian/templates/apache-shared-intranet.conf +++ b/debian/templates/apache-shared-intranet.conf @@ -14,6 +14,8 @@ ScriptAlias /search "/usr/share/koha/intranet/cgi-bin/catalogue/search.pl" # Protect dev package install RewriteEngine on RewriteRule ^/cgi-bin/koha/(C4|debian|docs|etc|installer/data|install_misc|Koha|misc|selenium|t|test|tmp|xt)/|\.PL$ /notfound [PT] +# Do not allow hitting value_builder pages directly +RewriteRule ^/cgi-bin/koha/cataloguing/value_builder/ /cgi-bin/koha/errors/403.pl [PT] RewriteRule ^/bib/([^\/]*)/?$ /cgi-bin/koha/catalogue/detail.pl?biblionumber=$1 [PT] RewriteRule ^/isbn/([^\/]*)/?$ /search?q=isbn:$1 [PT] @@ -38,4 +40,4 @@ Alias "/api" "/usr/share/koha/api" RewriteBase /api/ RewriteCond %{REQUEST_URI} !^/api/v[0-1]+/app.pl RewriteRule ^(v[0-9]+)/(.*)$ /api/$1/app.pl/api/$1/$2 [L] - \ No newline at end of file + -- 2.39.5