[Bug 43832] New: Default CSP external cover images on the OPAC
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Bug ID: 43832 Summary: Default CSP external cover images on the OPAC Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: normal Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: f.demians@tamil.fr QA Contact: testopia@bugs.koha-community.org Target Milestone: --- Since bug 38365, the OPAC can send a Content-Security-Policy header. When csp_mode is set to "enabled" and csp_header_value is left empty, Koha uses a hard-coded default policy (Koha/ContentSecurityPolicy.pm): default-src 'self'; script-src 'self' 'nonce-_CSP_NONCE_'; style-src 'self' 'nonce-_CSP_NONCE_'; style-src-attr 'unsafe-inline'; img-src 'self' data:; font-src 'self'; object-src 'none' This policy doesn't depend on system preferences. With it, every cover image service that loads its images, or its data, from another host stops working, without any message in the staff interface. Only local covers (OPACLocalCoverImages, OPACCustomCoverImages pointing to the Koha server) are displayed. koha-testing-docker enables the OPAC CSP, so this can be seen there: 1. In koha-conf.xml, set <csp_mode>enabled</csp_mode> for the OPAC, with an empty <csp_header_value> (the default in KTD), and restart_all. 2. Enable OPACAmazonCoverImages (or GoogleJackets, OpenLibraryCovers). 3. Open the detail page of a record with an ISBN on the OPAC. 4. No cover is displayed. The browser console reports CSP violations. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #1 from Frédéric Demians <f.demians@tamil.fr> --- Created attachment 208236 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208236&action=edit Bug 43832: Document CSP sources for cover image services The hard-coded Content-Security-Policy only allows images served by Koha. With csp_mode set to "enabled", the OPAC cover image services loading their images, or their data with JSONP, from another host stop working: Amazon, Google, Open Library, Syndetics and Coce. This patch documents, in koha-conf.xml and in the koha-conf template of the Debian packages, the sources to add to a custom csp_header_value for each of these services, with an example of OPAC policy. Test plan: 1. In koha-conf.xml (/etc/koha/sites/kohadev/koha-conf.xml in KTD), set <csp_mode>enabled</csp_mode> for the OPAC with an empty <csp_header_value>, and restart_all. 2. Enable OPACAmazonCoverImages, and open the detail page of a record with an ISBN on the OPAC (biblionumber=6 in KTD sample data): no cover, the browser console reports a CSP violation on img-src. 3. Disable OPACAmazonCoverImages and repeat with GoogleJackets, then OpenLibraryCovers: no cover, a CSP violation on script-src. 4. Repeat with OpacCoce, CoceHost=https://coce.tamil.fr, CoceProviders=aws,gb,ol: no cover, a CSP violation on script-src. 5. Apply this patch and read the new "Cover images" paragraph of the CSP documentation in etc/koha-conf.xml. 6. Copy the example policy into <csp_header_value>, replacing coce.example.org by coce.tamil.fr, and add to script-src https://books.google.com https://openlibrary.org. restart_all. 7. Repeat steps 2 to 4: the covers are displayed, without CSP violation. 8. Check that debian/templates/koha-conf-site.xml.in has the same paragraph. Syndetics needs a client code and could not be tested; its host, secure.syndetics.com, is the one used by the OPAC templates. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #2 from Frédéric Demians <f.demians@tamil.fr> --- Created attachment 208237 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208237&action=edit Bug 43832: Add a CSP note to cover image preferences The cover image preferences of the OPAC don't work when the OPAC Content-Security-Policy is enabled with Koha hard-coded policy. This patch adds a note to their description, pointing to the documentation of koha-conf.xml added by the previous patch: - OPACAmazonCoverImages - GoogleJackets - OpenLibraryCovers - SyndeticsCoverImages - OpacCoce Test plan: 1. Apply this patch. 2. Go to Administration > System preferences > Enhanced content. 3. Check that the five preferences above have a note about the OPAC Content-Security-Policy below their description. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off Patch complexity|--- |Small patch -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208236|0 |1 is obsolete| | Attachment #208237|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #3 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 208330 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208330&action=edit Bug 43832: Document CSP sources for cover image services The hard-coded Content-Security-Policy only allows images served by Koha. With csp_mode set to "enabled", the OPAC cover image services loading their images, or their data with JSONP, from another host stop working: Amazon, Google, Open Library, Syndetics and Coce. This patch documents, in koha-conf.xml and in the koha-conf template of the Debian packages, the sources to add to a custom csp_header_value for each of these services, with an example of OPAC policy. Test plan: 1. In koha-conf.xml (/etc/koha/sites/kohadev/koha-conf.xml in KTD), set <csp_mode>enabled</csp_mode> for the OPAC with an empty <csp_header_value>, and restart_all. 2. Enable OPACAmazonCoverImages, and open the detail page of a record with an ISBN on the OPAC (biblionumber=6 in KTD sample data): no cover, the browser console reports a CSP violation on img-src. 3. Disable OPACAmazonCoverImages and repeat with GoogleJackets, then OpenLibraryCovers: no cover, a CSP violation on script-src. 4. Repeat with OpacCoce, CoceHost=https://coce.tamil.fr, CoceProviders=aws,gb,ol: no cover, a CSP violation on script-src. 5. Apply this patch and read the new "Cover images" paragraph of the CSP documentation in etc/koha-conf.xml. 6. Copy the example policy into <csp_header_value>, replacing coce.example.org by coce.tamil.fr, and add to script-src https://books.google.com https://openlibrary.org. restart_all. 7. Repeat steps 2 to 4: the covers are displayed, without CSP violation. 8. Check that debian/templates/koha-conf-site.xml.in has the same paragraph. Syndetics needs a client code and could not be tested; its host, secure.syndetics.com, is the one used by the OPAC templates. Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #4 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 208331 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208331&action=edit Bug 43832: Add a CSP note to cover image preferences The cover image preferences of the OPAC don't work when the OPAC Content-Security-Policy is enabled with Koha hard-coded policy. This patch adds a note to their description, pointing to the documentation of koha-conf.xml added by the previous patch: - OPACAmazonCoverImages - GoogleJackets - OpenLibraryCovers - SyndeticsCoverImages - OpacCoce Test plan: 1. Apply this patch. 2. Go to Administration > System preferences > Enhanced content. 3. Check that the five preferences above have a note about the OPAC Content-Security-Policy below their description. Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #5 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 208332 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208332&action=edit Bug 43832: (follow-up) Update wording of preference note Also adding a similar note to preferences which affect the staff interfaces. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #6 from Frédéric Demians <f.demians@tamil.fr> --- Thanks Owen for the sign-off and for the rewording, which reads better! I see that koha-conf.xml warns that the staff interface is "not yet production ready" for the CSP "enabled" mode, so the staff notes are less urgent than the OPAC ones. So I'd prefer not to deal this situation. And, side note, my patches missed too: CustomCoverImages and OPACCustomCoverImages... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Needs Signoff -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Frédéric Demians <f.demians@tamil.fr> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208330|0 |1 is obsolete| | Attachment #208331|0 |1 is obsolete| | Attachment #208332|0 |1 is obsolete| | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #7 from Frédéric Demians <f.demians@tamil.fr> --- Created attachment 208346 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=208346&action=edit Bug 43832: Document CSP sources for OPAC cover image services The hard-coded Content-Security-Policy only allows images served by Koha. With csp_mode set to "enabled", the OPAC cover image services loading their images, or their data with JSONP, from another host stop working: Amazon, Google, Open Library, Syndetics and Coce. This patch: - documents, in koha-conf.xml and in the koha-conf template of the Debian packages, the sources to add to a custom csp_header_value for each of these services, with an example of OPAC policy; - adds a note to the OPAC cover image preferences, pointing to this documentation: OPACAmazonCoverImages, GoogleJackets, OpenLibraryCovers, SyndeticsCoverImages and OpacCoce. The wording of the note is Owen's. Only the OPAC is concerned: koha-conf.xml warns that the staff interface is not yet production ready for the "enabled" mode, so the CSP doesn't apply there for now. The staff interface preferences can get the same documentation when it does. Test plan: 1. In koha-conf.xml (/etc/koha/sites/kohadev/koha-conf.xml in KTD), set <csp_mode>enabled</csp_mode> for the OPAC with an empty <csp_header_value>, and restart_all. 2. Enable OPACAmazonCoverImages, and open the detail page of a record with an ISBN on the OPAC (biblionumber=6 in KTD sample data): no cover, the browser console reports a CSP violation on img-src. 3. Disable OPACAmazonCoverImages and repeat with GoogleJackets, then OpenLibraryCovers: no cover, a CSP violation on script-src. 4. Repeat with OpacCoce, CoceHost=https://coce.tamil.fr, CoceProviders=aws,gb,ol: no cover, a CSP violation on script-src. 5. Apply this patch and read the new "Cover images" paragraph of the CSP documentation in etc/koha-conf.xml. 6. Copy the example policy into <csp_header_value>, replacing coce.example.org by coce.tamil.fr, and add to script-src https://books.google.com https://openlibrary.org. restart_all. 7. Repeat steps 2 to 4: the covers are displayed, without CSP violation. 8. Check that debian/templates/koha-conf-site.xml.in has the same paragraph. 9. Go to Administration > System preferences > Enhanced content, and check that the five preferences above have a note about the OPAC Content Security Policy below their description. Syndetics needs a client code and could not be tested; its host, secure.syndetics.com, is the one used by the OPAC templates. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #8 from Owen Leonard <oleonard@myacpl.org> ---
I see that koha-conf.xml warns that the staff interface is "not yet production ready" for the CSP "enabled" mode
Ah, got it! -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #9 from Owen Leonard <oleonard@myacpl.org> --- I don't know if the example is meant to be comprehensive but I found I also need ed these in the script-src section: https://books.google.com https://openlibrary.org And these in the img-src section: https://openlibrary.org https://archive.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #10 from Frédéric Demians <f.demians@tamil.fr> --- (In reply to Owen Leonard from comment #9)
I don't know if the example is meant to be comprehensive but I found I also need ed these in the script-src section:
https://books.google.com https://openlibrary.org
And these in the img-src section:
It's supposed to be documented in koha-conf.xml, per provider: - GoogleJackets: script-src https://books.google.com img-src https://books.google.com CSP is a clear nuisance. Otherwise, instead of having admins configure CSP permissions for cover providers one by one, we could just as well settle on an exhaustive list of these providers. After all, their URLs should be very, very stable and safe. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #11 from Owen Leonard <oleonard@myacpl.org> --- The format of the most recent patch is wrong: "Patch format detection failed." -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #12 from Frédéric Demians <f.demians@tamil.fr> --- (In reply to Owen Leonard from comment #11)
The format of the most recent patch is wrong: "Patch format detection failed."
I can't reproduce. Do you have an error message? Two other bugs are related to this one: 40394, 43843. The last one is pretty serious. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Signed Off -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #208346|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #13 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 209023 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209023&action=edit Bug 43832: Document CSP sources for OPAC cover image services The hard-coded Content-Security-Policy only allows images served by Koha. With csp_mode set to "enabled", the OPAC cover image services loading their images, or their data with JSONP, from another host stop working: Amazon, Google, Open Library, Syndetics and Coce. This patch: - documents, in koha-conf.xml and in the koha-conf template of the Debian packages, the sources to add to a custom csp_header_value for each of these services, with an example of OPAC policy; - adds a note to the OPAC cover image preferences, pointing to this documentation: OPACAmazonCoverImages, GoogleJackets, OpenLibraryCovers, SyndeticsCoverImages and OpacCoce. The wording of the note is Owen's. Only the OPAC is concerned: koha-conf.xml warns that the staff interface is not yet production ready for the "enabled" mode, so the CSP doesn't apply there for now. The staff interface preferences can get the same documentation when it does. Test plan: 1. In koha-conf.xml (/etc/koha/sites/kohadev/koha-conf.xml in KTD), set <csp_mode>enabled</csp_mode> for the OPAC with an empty <csp_header_value>, and restart_all. 2. Enable OPACAmazonCoverImages, and open the detail page of a record with an ISBN on the OPAC (biblionumber=6 in KTD sample data): no cover, the browser console reports a CSP violation on img-src. 3. Disable OPACAmazonCoverImages and repeat with GoogleJackets, then OpenLibraryCovers: no cover, a CSP violation on script-src. 4. Repeat with OpacCoce, CoceHost=https://coce.tamil.fr, CoceProviders=aws,gb,ol: no cover, a CSP violation on script-src. 5. Apply this patch and read the new "Cover images" paragraph of the CSP documentation in etc/koha-conf.xml. 6. Copy the example policy into <csp_header_value>, replacing coce.example.org by coce.tamil.fr, and add to script-src https://books.google.com https://openlibrary.org. restart_all. 7. Repeat steps 2 to 4: the covers are displayed, without CSP violation. 8. Check that debian/templates/koha-conf-site.xml.in has the same paragraph. 9. Go to Administration > System preferences > Enhanced content, and check that the five preferences above have a note about the OPAC Content Security Policy below their description. Syndetics needs a client code and could not be tested; its host, secure.syndetics.com, is the one used by the OPAC templates. Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #14 from Owen Leonard <oleonard@myacpl.org> --- (In reply to Owen Leonard from comment #11)
The format of the most recent patch is wrong: "Patch format detection failed."
No idea what my problem was yesterday. All good today. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |paul.derscheid@lmscloud.de QA Contact|testopia@bugs.koha-communit |paul.derscheid@lmscloud.de |y.org | -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Paul Derscheid <paul.derscheid@lmscloud.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #209023|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #15 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 209468 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209468&action=edit Bug 43832: Document CSP sources for OPAC cover image services The hard-coded Content-Security-Policy only allows images served by Koha. With csp_mode set to "enabled", the OPAC cover image services loading their images, or their data with JSONP, from another host stop working: Amazon, Google, Open Library, Syndetics and Coce. This patch: - documents, in koha-conf.xml and in the koha-conf template of the Debian packages, the sources to add to a custom csp_header_value for each of these services, with an example of OPAC policy; - adds a note to the OPAC cover image preferences, pointing to this documentation: OPACAmazonCoverImages, GoogleJackets, OpenLibraryCovers, SyndeticsCoverImages and OpacCoce. The wording of the note is Owen's. Only the OPAC is concerned: koha-conf.xml warns that the staff interface is not yet production ready for the "enabled" mode, so the CSP doesn't apply there for now. The staff interface preferences can get the same documentation when it does. Test plan: 1. In koha-conf.xml (/etc/koha/sites/kohadev/koha-conf.xml in KTD), set <csp_mode>enabled</csp_mode> for the OPAC with an empty <csp_header_value>, and restart_all. 2. Enable OPACAmazonCoverImages, and open the detail page of a record with an ISBN on the OPAC (biblionumber=6 in KTD sample data): no cover, the browser console reports a CSP violation on img-src. 3. Disable OPACAmazonCoverImages and repeat with GoogleJackets, then OpenLibraryCovers: no cover, a CSP violation on script-src. 4. Repeat with OpacCoce, CoceHost=https://coce.tamil.fr, CoceProviders=aws,gb,ol: no cover, a CSP violation on script-src. 5. Apply this patch and read the new "Cover images" paragraph of the CSP documentation in etc/koha-conf.xml. 6. Copy the example policy into <csp_header_value>, replacing coce.example.org by coce.tamil.fr, and add to script-src https://books.google.com https://openlibrary.org. restart_all. 7. Repeat steps 2 to 4: the covers are displayed, without CSP violation. 8. Check that debian/templates/koha-conf-site.xml.in has the same paragraph. 9. Go to Administration > System preferences > Enhanced content, and check that the five preferences above have a note about the OPAC Content Security Policy below their description. Syndetics needs a client code and could not be tested; its host, secure.syndetics.com, is the one used by the OPAC templates. Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #16 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 209469 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209469&action=edit Bug 43832: (QA follow-up) Allow the archive.org redirect hop for Open Library covers Archived Open Library covers redirect covers.openlibrary.org -> archive.org -> iaNNN.us.archive.org. CSP checks every redirect hop, so without https://archive.org in img-src these covers are blocked. - add https://archive.org to the Open Library, Coce and example img-src - older covers are the redirected ones, not recent ones Test plan: 1. In /etc/koha/sites/kohadev/koha-conf.xml, set for the OPAC <csp_mode>enabled</csp_mode> and a <csp_header_value> with the Open Library sources of the previous patch: script-src https://openlibrary.org img-src https://covers.openlibrary.org https://*.us.archive.org 2. Enable OpenLibraryCovers, restart_all 3. Open /cgi-bin/koha/opac-detail.pl?biblionumber=6 (X Power Tools, served directly): the cover is displayed 4. Open /cgi-bin/koha/opac-detail.pl?biblionumber=1 (E Street shuffle, archived): no cover, the console reports: Loading the image 'https://archive.org/download/olcovers253/olcovers253-L.zip/2536391-L.jpg' violates the following Content Security Policy directive: "img-src 'self' data: https://covers.openlibrary.org https://*.us.archive.org". The action has been blocked. 5. Apply this patch, add https://archive.org to img-src as documented, restart_all 6. Reload biblionumber=1: the cover is displayed, no CSP violation Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #17 from Paul Derscheid <paul.derscheid@lmscloud.de> --- Created attachment 209470 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209470&action=edit Bug 43832: (QA follow-up) Document CSP sources for OPACCustomCoverImages Custom cover images are loaded from the CustomCoverImagesURL host, and from any host it redirects to, which the hard-coded CSP blocks too. - document the img-src entry in koha-conf.xml and the Debian template - add the CSP note to the CustomCoverImages preferences Test plan: 1. Keep the OPAC CSP of the previous patch's test plan, with OpenLibraryCovers disabled 2. Set OPACCustomCoverImages to "Show" and CustomCoverImagesURL to {024$a} 3. Add to record biblionumber=2 (The ideas behind the chess openings) a 024 8_ $a https://picsum.photos/id/237/200/300 (redirected to fastly.picsum.photos) 4. Open /cgi-bin/koha/opac-detail.pl?biblionumber=2: no cover, the console reports: Loading the image 'https://picsum.photos/id/237/200/300' violates the following Content Security Policy directive: "img-src 'self' data: https://covers.openlibrary.org https://archive.org https://*.us.archive.org". The action has been blocked. 5. Apply this patch, add https://picsum.photos https://fastly.picsum.photos to img-src as documented, restart_all 6. Reload biblionumber=2: the custom cover is displayed, no CSP violation 7. Administration > System preferences > Enhanced content: the custom cover images preferences show the CSP note Assisted-by: Opus 5.5 (Anthropic) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |f.demians@tamil.fr |ity.org | CC| |pedro.amorim@openfifth.co.u | |k -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to main Version(s)| |26.11.00 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43832 --- Comment #18 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Thanks everyone! Pushed to main for 26.11! -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org