Koha-clms/C4
Marcel de Rooy 74fe3f5cda Bug 18010: Remove potential exposure from gettemplate
A similar bad template check from C4::Auth::get_template_and_user
should be applied in C4::Templates::gettemplate.

Before this patch it would be possible to expose files like:
my $template = C4::Templates::gettemplate(
    '/etc/passwd', 'intranet', CGI::new, 1
);
print $template->output;

Note that the is_plugin flag in the above call is the culprit. This patch
provides a quick security fix without touching get_template_and_user, and
can be backported to stable branches.
I will provide an enhanced and centralized check on report 17989, also
removing the is_plugin flag.

Note: We allow .pref here too for use in admin/preferences.pl.

Test plan:
[1] Run t/db_dependent/Auth.t (triggering get_template_and_user and
    gettemplate).
[2] Run t/db_dependent/Templates.t again (see first test plan).
    The tests should no longer fail.
[3] Open a page on opac or intranet.
[4] Open a systempreferences tab.
[5] Add a book to the cart and send it ([opac-]sendbasket uses gettemplate).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Signed-off-by: Brendan A Gallagher <brendan@bywatersolutions.com>
(cherry picked from commit fbbd4b40f0)
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
2017-03-26 21:05:43 +00:00
..
AuthoritiesMarc
…
Barcodes Bug 14752 - (QA followup) Remove annoying modal, use dialog box instead 2016-09-13 17:21:05 +00:00
Bookseller Bug 5260 - Add option to send an order by e-mail to the acquisition module 2016-10-28 11:52:25 +00:00
ClassSortRoutine
…
Creators Bug 18044: Label Batches not displaying 2017-02-07 22:08:28 +01:00
External Bug 17189: Replace occurrences of 'use Koha::Cache' 2016-09-08 10:24:47 +00:00
Form
…
Heading
…
ILSDI Bug 10455: (follow-up 2) Remove biblioitems.marc 2016-10-21 14:35:00 +00:00
Installer Bug 17986: Perl dependency evaluation incorrect 2017-01-30 15:35:20 +01:00
Labels Bug 15758: Koha::Libraries - Remove GetBranchName 2016-09-08 14:36:01 +00:00
Linker
…
Members Bug 10227 : Fix GetMessagingPreferences when digest is possible 2016-09-13 17:14:28 +00:00
OAI
…
Output
…
Patroncards
…
Reports Bug 17535: Fix search for reports by keywords 2016-11-07 16:38:25 +00:00
SIP Bug 15901 - Remove use of recordpayment in C4::SIP::ILS::Transaction::FeePayment 2016-09-27 13:52:34 +00:00
Search Bug 17323: Column search_history.time cannot be null 2016-11-18 13:51:37 +00:00
Serials
…
Utils Bug 18094: Only search in searchable patron attributes if searching in standard fields 2017-03-26 20:53:33 +00:00
Accounts.pm Bug 15899 - Remove C4::Accounts::recordpayment 2016-09-27 13:55:12 +00:00
Acquisition.pm Bug 17563: (followup) Silence undef warnings 2016-11-10 13:36:48 +00:00
Auth.pm Bug 18275: Do not rely on CGI param userid to log a user in if auth is not required 2017-03-16 23:35:07 +01:00
Auth_cas_servers.yaml.sample Bug 17065 - Rename C4/Auth_cas_servers.yaml.orig 2016-08-08 13:16:36 +00:00
Auth_with_cas.pm Bug 17481: Fix incorrect merge of bug 11048 (logout redirection for CAS authentication) 2016-11-07 16:34:57 +00:00
Auth_with_ldap.pm Bug 17775 - Add new user with LDAP not works under Plack 2017-02-07 22:07:31 +01:00
Auth_with_shibboleth.pm Bug 16818: External auth redirect broken under Plack 2016-08-04 19:42:44 +00:00
AuthoritiesMarc.pm Bug 17913: [16.11.x] followup 2017-02-14 22:26:18 +01:00
BackgroundJob.pm
…
Barcodes.pm
…
Biblio.pm Bug 10455: (follow-up) Remove biblioitems.marc 2016-10-21 14:34:59 +00:00
Bookseller.pm Bug 13321: Rename variables 2016-10-28 13:45:59 +00:00
Boolean.pm
…
Breeding.pm
…
Budgets.pm Bug 16123 - Display budget hierarchy in the budget dropdown menu used when placing a new order 2016-10-28 15:26:00 +00:00
Calendar.pm Bug 17189: Replace occurrences of 'use Koha::Cache' 2016-09-08 10:24:47 +00:00
Charset.pm
…
Circulation.pm Bug 16202: GetIssuingCharges should return a collectable amount 2017-03-14 17:34:01 +01:00
ClassSortRoutine.pm
…
ClassSource.pm
…
Context.pm Bug 16520 - (Follow up) Restore retrieval of syspref_cache 2016-11-15 14:09:33 +00:00
Contract.pm
…
CourseReserves.pm
…
Creators.pm
…
Debug.pm
…
HTML5Media.pm Bug 17231 - (QA Followup) 2016-09-08 12:06:47 +00:00
Heading.pm
…
HoldsQueue.pm Bug 14514 - LocalHoldsPriority and the HoldsQueue conflict with each other 2016-10-11 15:44:47 +00:00
Images.pm
…
ImportBatch.pm Bug 6852: Staged import reports wrong success for items 2016-09-12 08:55:41 +00:00
ImportExportFramework.pm Bug 17389: Clear logs 2016-10-11 16:18:10 +00:00
InstallAuth.pm
…
Installer.pm Bug 17234: Need to separate KEY and FOREIGN KEY checks 2017-01-15 17:06:47 +01:00
ItemCirculationAlertPreference.pm Bug 15407: Koha::Patron::Categories - replace C4::Category->all 2016-09-08 13:29:03 +00:00
Items.pm Bug 17512: Improve handling dates in C4::Items 2017-02-14 22:26:17 +01:00
Koha.pm Bug 15803: Koha::AuthorisedValues - Remove C4::Koha::GetAuthorisedValueCategories 2016-10-28 16:35:52 +00:00
Labels.pm
…
Languages.pm Bug 16770: Remove wrong caching of 3 subroutines in C4::Lancuages 2016-06-24 14:05:56 +00:00
Letters.pm Bug 17904: Fix possible SQL injection in late orders 2017-01-30 15:58:05 +01:00
Linker.pm
…
Log.pm Bug 14642: Add logging for Holds 2016-08-17 18:43:13 +00:00
MarcModificationTemplates.pm
…
Matcher.pm Bug 14629 - Add aggressive ISSN matching feature equivalent to the aggressive ISBN matcher 2016-10-28 11:58:14 +00:00
Members.pm Bug 15690: Hardcoded 16 is uncool 2016-11-14 11:28:43 +00:00
Message.pm
…
NewsChannels.pm Bug 16550: Can't set opac news expiration date to NULL, it reverts to today 2016-05-23 17:37:48 +00:00
Output.pm
…
Overdues.pm Bug 17599: Move C4::Circulation::GetIssuingRule to Koha::IssuingRules->get_effective_issuing_rule 2016-11-15 15:41:43 +00:00
Patroncards.pm
…
Print.pm
…
Record.pm Bug 17249: Remove GetKohaAuthorisedValuesFromField - Add search_by_marc_field 2016-10-21 15:13:56 +00:00
Reports.pm
…
Reserves.pm Bug 18150 - CanItemBeReserved doesn't work with (IndependentBranches AND ! canreservefromotherbranches) 2017-03-26 20:29:58 +00:00
Ris.pm Bug 16245: [QA Follow-up] Replace typeofrecord2 by biblevel 2016-10-21 14:51:55 +00:00
RotatingCollections.pm
…
SMS.pm
…
Scheduler.pm
…
Scrubber.pm
…
Search.pm Bug 15822: Fix 500 error when searching if items.onloan=0000-00-00 2016-12-12 23:09:34 +01:00
Serials.pm Bug 17865 'If a subscription has no history end date, it shows as expired today in OPAC' 2017-02-21 22:03:28 +01:00
Service.pm
…
ShelfBrowser.pm Bug 15758: Koha::Libraries - Remove GetBranches 2016-09-08 14:36:03 +00:00
SocialData.pm
…
Stats.pm
…
Suggestions.pm
…
TTParser.pm
…
Tags.pm Bug 16637: Dependency for C4::Tags not listed 2016-06-10 18:05:10 +00:00
Templates.pm Bug 18010: Remove potential exposure from gettemplate 2017-03-26 21:05:43 +00:00
TmplToken.pm
…
TmplTokenType.pm
…
UsageStats.pm Bug 15131: Add AllowItemsOnHoldCheckoutSCO to UsageStats 2016-10-21 17:27:07 +00:00
XISBN.pm
…
XSLT.pm Bug 18089 - All XSLT testing singleBranchMode = 0 fails to show even if install has only 1 branch 2017-02-14 22:26:18 +01:00