https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44329 Bug ID: 44329 Summary: A failed SUSHI harvest writes the provider's api_key to the log and to the error message Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: minor Priority: P5 - low Component: ERM Assignee: koha-bugs@lists.koha-community.org Reporter: babarjunaid1122@gmail.com QA Contact: testopia@bugs.koha-community.org CC: jonathan.druart@gmail.com, jonathan.field@openfifth.co.uk, martin.renvoize@openfifth.co.uk, matt.blenkinsop@openfifth.co.uk, pedro.amorim@openfifth.co.uk Target Milestone: --- When a SUSHI service answers a harvest with an HTTP error, Koha::ERM::EUsage::UsageDataProvider->harvest_sushi warns and dies with the full request URL: warn sprintf "ERROR - SUSHI service %s returned %s - %s\n", $url, ... die sprintf "ERROR requesting SUSHI service\n%s\ncode %s: %s\n", $url, ... The URL is built by _build_url_query with &api_key=<the provider's key>, so the key ends up in plack-error.log (or the worker's log) and in the background job's error, for every failed harvest. To reproduce (main), see the new subtest in t/db_dependent/Koha/ERM/EUsage/UsageDataProvider.t: a provider with api_key SECRET-KEY-123 and a SUSHI service answering 500 → the warning and the error both contain SECRET-KEY-123. Expected: the key is masked in what is logged or shown (api_key=*****); the request itself is unchanged (COUNTER SUSHI passes api_key as a query parameter). Reproduced on main (af3f590). -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.