Koha-clms/members
Phil Ringnalda 06acaf74f6 Bug 37786: members/cancel-charge.pl needs CSRF protection
members/cancel-charge.pl will take either a POST or a GET, and as long as the
accountline_id it is passed can be cancelled, will cancel it. That means any
link you click anywhere while logged in to Koha might cancel a charge. It also
takes a borrowernumber which isn't used for the cancelling, only to determine
what account to show after a charge is cancelled, letting a malicious link
show an account other than the one whose charge was just cancelled.

Test plan:
 1. Without the patch, Circulation - Checkout - search for the 'koha' patron
    you log in as
 2. Accounting - Create manual invoice - Make it a Manual fee of 100.00 and
    Save
 3. Pretending it's a well-disguised link in a spear-phishing email, load
    http://localhost:8081/cgi-bin/koha/members/cancel-charge.pl?borrowernumber=5&accountlines_id=1
 4. You are now looking at charges for the patron Acosta, Edna rather than for
    the patron koha, but if you look at the patron koha, its 100.00 charge
    has been cancelled.
 5. Apply patch and reset_all (or if you don't, you'll have to manually adjust
    the link to reflect the charge being accountlines_id 3 rather than 1)
 6. Circulation - Checkout - search for the 'koha' patron you log in as
 7. Accounting - Create manual invoice - Make it a Manual fee of 100.00 and
    Save
 8. Click the link http://localhost:8081/cgi-bin/koha/members/cancel-charge.pl?borrowernumber=5&accountlines_id=1
 9. You got a 403 because you didn't pass the op cud-cancel, but if you did
    pass that op, you would also get a 403 for having a cud- op in a GET (and
    if you POST, you won't have a csrf_token)
10. Checkout - search for koha - Accounting - Cancel charge
11. Having done it the right way, you're now on koha's list of transactions,
    where you can see you just cancelled it

Sponsored-by: Chetco Community Public Library

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2024-11-07 23:02:54 +00:00
..
accountline-details.pl Bug 22435: Update accountline-details page to show all history 2021-08-04 14:06:43 +02:00
alert-subscriptions.pl Bug 34478: Manual fix - add cud- op - alert-subscriptions.pl 2024-03-01 10:59:46 +01:00
apikeys.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
boraccount.pl Bug 36190: Fix problems found by test 2024-03-15 09:38:54 +01:00
cancel-charge.pl Bug 37786: members/cancel-charge.pl needs CSRF protection 2024-11-07 23:02:54 +00:00
default_messageprefs.pl Bug 18403: Update permissions - borrowers => 1|* becomes borrowers => 'edit_borrowers' 2018-02-12 15:41:37 -03:00
deletemem.pl Bug 34478: (follow-up) Remove check_csrf from pl files 2024-03-01 10:58:41 +01:00
discharge.pl Bug 34478: Manual fix - add op - members/discharge 2024-03-01 10:57:27 +01:00
discharges.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
files.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00
holdshistory.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
housebound.pl Bug 34478: Fix various parameters on housebound details page 2024-03-01 10:59:37 +01:00
ill-requests.pl Bug 35581: Koha::Illrequest -> Koha::ILL::Request 2024-04-22 08:57:45 +02:00
mancredit.pl Bug 34478: Manual fix - add op - members/mancredit 2024-03-01 10:57:30 +01:00
maninvoice.pl Bug 34478: Manual fix - add op - members/maninvoice 2024-03-01 10:57:31 +01:00
member-flags.pl Bug 34478: Changes for members/member-flags 2024-03-01 10:57:46 +01:00
member-password.pl Bug 33832: Allow updating username without changing password on member-password.pl 2024-04-18 16:51:11 +02:00
member.pl Bug 36302: members-home.pl defers loading, member.pl does not 2024-04-03 09:53:31 +02:00
memberentry.pl Bug 33849: Do not reset new patrons home library when error occurs 2024-05-13 10:36:09 +02:00
members-home.pl Bug 36302: members-home.pl defers loading, member.pl does not 2024-04-03 09:53:31 +02:00
members-update-do.pl Bug 34478: Add missing op - members-update 2024-03-01 10:57:04 +01:00
members-update.pl Bug 29844: Fix ->search occurrences 2022-02-09 15:36:23 -10:00
merge-patrons.pl Bug 34478: Manual fix - Rename action with op change to post - merge-patrons 2024-03-01 10:56:40 +01:00
mod_debarment.pl Bug 34478: Rename action with op - mod_debarment 2024-03-01 10:57:03 +01:00
moremember.pl Bug 36376: (QA follow-up) Tidy 2024-04-04 15:24:31 +02:00
notices.pl Bug 35279: Add fallback to print for 'Send welcome email' 2024-03-22 15:47:36 +01:00
patronimage.pl Bug 29541: Prevent users from another group to access patron's images 2022-02-02 21:05:29 -10:00
pay.pl Bug 34478: Add notes to pay.pl 2024-03-01 10:59:31 +01:00
paycollect.pl Bug 34478: Add cud-pay and cud-writeoff to paycollect 2024-03-01 10:59:30 +01:00
print_overdues.pl Bug 33478: Apply formatting to OVERDUES_SLIP 2024-04-26 20:15:42 +02:00
printfeercpt.pl Bug 33478: Apply formatting to ACCOUNT_CREDIT 2024-04-26 20:15:43 +02:00
printinvoice.pl Bug 33478: Apply formatting to ACCOUNT_DEBIT 2024-04-26 20:15:43 +02:00
printnotice.pl Bug 33478: Apply formatting to ACCOUNTS_SUMMARY 2024-04-26 20:15:45 +02:00
printslip.pl Bug 33478: Apply formatting to ISSUESLIP, ISSUEQSLIP, CHECKINSLIP 2024-04-26 20:15:41 +02:00
purchase-suggestions.pl Bug 35911: Make archived suggestions not show in patron's account 2024-03-08 18:58:23 +01:00
readingrec.pl Bug 33948: Replace GetAllIssues with Koha::Checkouts - staff 2023-09-22 12:35:49 -03:00
recallshistory.pl Bug 30291: Changes to staff client files 2022-05-05 11:17:36 -10:00
routing-lists.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
setstatus.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
statistics.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
summary-print.pl Bug 17600: Standardize our EXPORT_OK 2021-07-16 08:58:47 +02:00
two_factor_auth.pl Bug 34478: op =~ ^cud- in pl/pm - Manual cud-email => email 2024-03-01 10:57:14 +01:00
update-child.pl Bug 34478: op =~ ^cud- in pl/pm 2024-03-01 10:56:11 +01:00