Closed (fixed)
Project:
Node access node reference
Version:
7.x-1.x-dev
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2012 at 13:23 UTC
Updated:
26 Jul 2012 at 02:21 UTC
When used in conjunction with nodeaccess_password, if an anonymous user accesses a node using the correct password, the cache_set() in nodeaccess_nodereference_calculate_grants() causes a grant to be cached for user 0, which is then retrieved by nodeaccess_nodereference_node_grants() on future node views.
This means that the first anonymous user to access a protected node with the correct password effectively "unlocks" that node to the rest of the world, so anyone can access it from any browser or IP address, without logging in or entering a password.
Comments
Comment #1
morbiD commentedThis is probably going to be an extremely rare occurance. It only happens with funky combinations of node references and passing on of permissions, possibly only with the use of the propagate settings in #1471584: Passing grants to referred nodes.
The config I was using that triggered this was pretty random, but I had 3 content types (let's call them A, B and C).
B inferred view permissions from A.
C also passed view permissions to B and B also passed view permissions to A.
I set up password protection on B.
So when anonymous viewed B, the view permission bounced to A and back to B, which caused the caching issue.
I've altered my settings slightly by stopping B inferring from A since it was unnecessary, and the issue has stopped.
I don't know if this kind of occurrance should be solved here or in the other issue.
Comment #2
danielb commentedSo basically you're saying... don't call set_cache when uid is 0 ?
Comment #3
morbiD commentedYeah, that would work. I originally traced the issue by commenting out the set_cache().
I was wondering if there was any better way to handle it without completely disabling caching for user 0, but if you're happy with that :)
Comment #4
danielb commentedIf the uid is 0 it'll use the session id instead now