When viewing a 'child-page' of a book, the link to go 'up' to it's parent page is always shown, even if the user has no access to that page. Clicking on that link will give a 403 page. Not dramatic, but still not nice. The 'previous' and 'next' links have proper access checks already.
Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | Screen Shot 2021-06-28 at 7.39.07 PM.png | 15.36 KB | pameeela |
| #21 | Screen Shot 2021-06-28 at 7.37.57 PM.png | 18.08 KB | pameeela |
| #10 | book_parent_access-428850-10.patch | 4.84 KB | smartinm |
| #8 | book_parent_access_D8-428850-8.patch | 938 bytes | bartlantz |
| #2 | book-parent-access-428850-2-D6.patch | 1.12 KB | pwolanin |
Comments
Comment #1
pwolanin commentedThe security team decided that this issue could be fixed in public since it's very minor.
Comment #2
pwolanin commentedpatch applies to D6 with fuzz - here's a clean version
Comment #3
webchickFor D7, we're going to want some tests to validate that this doesn't recur. It'd in fact be good to test that an unpublished node doesn't occur in either the next, prev, OR up links.
Comment #4
gábor hojtsyGood idea to have this tested too.
Comment #5
pwolanin commentedsure, or in the list of child nodes
However, D7 node access queries have changed some, so test results will be a little irrelevant for D6 perhaps.
Comment #7
Anonymous (not verified) commentedIt looks like test coverage was never added to D7 for this.
Comment #8
bartlantz commentedhere's the patch in #2 rerolled for drupal 8. I'm working on a test for this too, should have that uploaded soon.
Comment #9
bartlantz commentedAlso, I should add, I was able to reproduce this bug in Drupal 8. And after I applied the re-rolled patch in #8, the bug was fixed. I'm still working on the simpletest, that should be posted soon.
Comment #10
smartinm commentedThis is my attempt at a patch for this issue:
testBookNodeAccessto test that a private node doesn't occur in either the next, previous, up or the list of child links.variable_set('node_access_test_private', TRUE);like in others node access tests (ForumNodeAccessTest, TrackerNodeAccessTest,...) instead of give anonymous users the permission 'node test view'.This change is needed to test private node access. This also fixes
testBookExport()bug in "Anonymous user is not shown link to printer-friendly version", in current implementationassertNoLink()will always evaluate to true because the response is 403.Comment #11
socketwench commentedNovice issue cleanup.
Comment #12
pwolanin commentedAlmost certainly doesn't apply now.
Comment #21
pameeela commentedI can't reproduce this anymore. Steps to test:
Parent page published:

Parent page unpublished:

I'm not sure what other method could be used for controlling access besides published/unpublished. If anyone can reproduce this still, please update the issue summary with the steps and set the issue back to 'Active'.