Bug 38463 - Unnecessary CSRF token in OPAC authority search
Summary: Unnecessary CSRF token in OPAC authority search
Status: Signed Off
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: Main
Hardware: All All
: P5 - low minor
Assignee: Phil Ringnalda
QA Contact: Testopia
URL:
Keywords:
Depends on: 36192 37069
Blocks:
  Show dependency treegraph
 
Reported: 2024-11-15 22:05 UTC by Phil Ringnalda
Modified: 2024-11-15 22:48 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This fixes the OPAC authority search result URL so that it no longer includes the CSRF token, and makes the URL more readable. (This is related to the CSRF changes added in Koha 24.05 to improve form security.)
Version(s) released in:
Circulation function:


Attachments
Bug 38463: Unnecessary CSRF token in OPAC authority search (2.27 KB, patch)
2024-11-15 22:24 UTC, Phil Ringnalda
Details | Diff | Splinter Review
Bug 38463: Unnecessary CSRF token in OPAC authority search (2.32 KB, patch)
2024-11-15 22:46 UTC, David Nind
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Phil Ringnalda 2024-11-15 22:05:12 UTC
Bug 37069 correctly changed OPAC authority searches from a POST to a GET, but forgot to remove the CSRF token that is only needed for a POST, so now it clutters up the URL by making the first 107 characters of the query string meaningless.
Comment 1 Phil Ringnalda 2024-11-15 22:24:18 UTC
Created attachment 174635 [details] [review]
Bug 38463: Unnecessary CSRF token in OPAC authority search

Bug 37069 correctly changed OPAC authority searches from a POST to a GET, but
forgot to remove the CSRF token that is only needed for a POST, so now it
clutters up the URL by making the first 107 characters of the query string
meaningless.

Test plan:
 1. Without the patch, in the OPAC, go to Authority search
 2. Change the dropdowns to non-default values so you have meaningful search
    conditions, and search for something that will return results, like
    Topical Term/starts with/a/in any heading/Heading descendant
 3. Copy the URL of your search results, paste it in an email compose window,
    look at what you just pasted and wonder whether that big opaque string is
    actually safe to send to a coworker. Go to lunch. Come back and wonder
    what you searched for, and look at the URL in the browser to try to tell
 4. Apply patch, click the browser back button, reload the page, search again
 5. Copy and paste the URL, notice it looks fine to send, just a search. Look
    at the URL in the browser address bar, notice that within the limits of
    your window size, you can see what you searched for

Sponsored-by: Chetco Community Public Library
Comment 2 David Nind 2024-11-15 22:46:30 UTC
Created attachment 174637 [details] [review]
Bug 38463: Unnecessary CSRF token in OPAC authority search

Bug 37069 correctly changed OPAC authority searches from a POST to a GET, but
forgot to remove the CSRF token that is only needed for a POST, so now it
clutters up the URL by making the first 107 characters of the query string
meaningless.

Test plan:
 1. Without the patch, in the OPAC, go to Authority search
 2. Change the dropdowns to non-default values so you have meaningful search
    conditions, and search for something that will return results, like
    Topical Term/starts with/a/in any heading/Heading descendant
 3. Copy the URL of your search results, paste it in an email compose window,
    look at what you just pasted and wonder whether that big opaque string is
    actually safe to send to a coworker. Go to lunch. Come back and wonder
    what you searched for, and look at the URL in the browser to try to tell
 4. Apply patch, click the browser back button, reload the page, search again
 5. Copy and paste the URL, notice it looks fine to send, just a search. Look
    at the URL in the browser address bar, notice that within the limits of
    your window size, you can see what you searched for

Sponsored-by: Chetco Community Public Library
Signed-off-by: David Nind <david@davidnind.com>