diff --git a/C4/Reports/Guided.pm b/C4/Reports/Guided.pm
index a55cd17743..f95243befc 100644
--- a/C4/Reports/Guided.pm
+++ b/C4/Reports/Guided.pm
@@ -615,6 +615,12 @@ sub execute_query {
};
warn $@ if $@;
+ foreach my $column ( @{ $sth->{NAME_lc} } ) {
+ if ( $column eq 'password' ) {
+ return ( $sth, { passworderr => $column } );
+ }
+ }
+
return ( $sth, { queryerr => $sth->errstr } ) if ($sth->err);
return ( $sth );
}
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
index 5d003efbed..4f0919e782 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
@@ -1426,6 +1426,10 @@
[% error.queryerr | html %]
Please check the log for further details.
[% ELSIF ( error.cache_expiry ) %]
Please select a cache expiry less than 30 days.
+ [% ELSIF ( error.passworderr ) %]
+ The column selection in this report includes a password field.
+ The report cannot be executed due to security risks.
+ Please edit this report and ensure no password columns have been selected.
[% ELSE %]
[% END %]