- Issue created by @larowlan
- Status changed to Needs work
about 1 year ago 8:24pm 19 October 2023 - π¨πSwitzerland berdir Switzerland
larowlan β credited Berdir β .
- π¦πΊAustralia jannakha Brisbane!
larowlan β credited jannakha β .
- Assigned to acbramley
- π¦πΊAustralia acbramley
Going to spend time on this this morning, thanks @larowlan!
- Merge request !5058Resolve #3395404 "Information disclosure access" β (Closed) created by acbramley
- last update
about 1 year ago 30,314 pass, 16 fail - π¦πΊAustralia acbramley
Got testGetIndividual and testRevisions passing but testCollection is a new beast due to the filter access stuff now that we don't have the admin permission.
Also opened π Tests extending jsonapi's ResourceTestBase are extremely hard to debug/maintain/deal with Active because these tests make working on these issues extremely time consuming.
We'll also need to fix getExpectedCollectionResponse (and whatever it calls for BlockContent) to remove the revision_log because during debugging I'm seeing it still come through....which I now realise is because we have
view any basic block content history
which grants access to the revision_log field based on the fieldAccess hook...this is impossible to deal with with this test setup. - π¦πΊAustralia acbramley
Aha! we have setUpRevisionAuthorization...onward.
- last update
about 1 year ago 30,314 pass, 16 fail - π¦πΊAustralia acbramley
BlockContentTest is now blocked by π BlockContent JSON:API collection endpoint doesn't return unpublished block when filtered without administer block content permission Needs review to get testCollection working.
- π¦πΊAustralia acbramley
I think the MediaTest failure is due to the access cache bug in π MediaAccessControlHandler update/delete access caching is not correct Needs work
MediaTest::testRevisions is failing because the actual document is missing the revision_log field. It should be there because the user is granted the view all media revisions permission via setUpRevisionAuthorization....
The view all revisions operation does:
$access = $this->access($media_storage->load($entity->id()), 'view', $account, TRUE);
When debugging this it's getting a cached access result and the reason is "The 'view media' permission is required when the media item is published."
If I put
$hasViewPerm = $account->hasPermission('view media');
right at the top of checkAccess, that's TRUE so something is off there with caching. 35:47 32:51 Running- last update
about 1 year ago 30,411 pass, 2 fail - last update
about 1 year ago 30,412 pass, 1 fail - Issue was unassigned.
- Status changed to Needs review
about 1 year ago 4:03am 20 October 2023 - π¦πΊAustralia acbramley
This is ready for a review, the final failure is fixed by π BlockContent JSON:API collection endpoint doesn't return unpublished block when filtered without administer block content permission Needs review which will need to be committed and then this branch will need a rebase.
- Status changed to Postponed
about 1 year ago 4:53pm 20 October 2023 - πΊπΈUnited States smustgrave
Just RTBC'd π BlockContent JSON:API collection endpoint doesn't return unpublished block when filtered without administer block content permission Needs review so when that's merged this should be good.
- Status changed to Needs work
about 1 year ago 10:25am 23 October 2023 - π¦πΊAustralia acbramley
The other issue is in! This just needs a rebase
- last update
about 1 year ago 30,439 pass - Status changed to Needs review
about 1 year ago 10:59pm 25 October 2023 - π¦πΊAustralia acbramley
Still need clarification on https://git.drupalcode.org/project/drupal/-/merge_requests/5058#note_220022 but otherwise should be good to go
- Status changed to RTBC
about 1 year ago 4:42pm 27 October 2023 - πΊπΈUnited States smustgrave
Tested with that one line removed which caused failures. So assuming it is needed. @larowlan mind double confirming.
- last update
about 1 year ago 30,456 pass, 1 fail - Status changed to Needs work
about 1 year ago 9:54pm 29 October 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Left a review on the MR
- Status changed to Needs review
about 1 year ago 11:20pm 29 October 2023 - Status changed to RTBC
about 1 year ago 4:34pm 30 October 2023 - last update
about 1 year ago 30,484 pass - π§πͺBelgium BramDriesen Belgium π§πͺ
Went through the code, overall looks very clean to me. Added two small nits, but will leave it at RTBC.
- π¨πSwitzerland berdir Switzerland
Also added a few comments, some of them should probably be addressed, others are more questions I suppose.
- π¦πΊAustralia acbramley
Thanks for the thorough review @Berdir, all feedback has been addressed.
- π¨πSwitzerland berdir Switzerland
The improvements look good to me.
I'm a little bit concerned about the performance impact of doing 3 entity access operations as part of that field access. I'm still not happy about the view all revisions access operation, that's still feels very strange. Obviously unrelated, but still not convinced that this is needed at all (are there any use cases where you can only access some revisions of an entity?) and if it is needed, I think it should be an access revision overview operation. Obviously I only just had that idea now not when reviewing it originally. Because in that case, we would not need to check that.
- last update
about 1 year ago 30,486 pass - π¦πΊAustralia acbramley
I think the horse has bolted on having
view revision
andview all revisions
, although I agree with you that it's a little odd. I think the difference is mainly whether you can view an individual revision's page (i.e node/1/revision/1/view) vs the revision overview (i.e node/1/revisions). - π¨πSwitzerland berdir Switzerland
> I think the difference is mainly whether you can view an individual revision's page (i.e node/1/revision/1/view) vs the revision overview (i.e node/1/revisions).
Yes, exactly, but then we shouldn't have to check both operations for the first case, meaning, we should make the "mostly" an "always/exlusively".
We could rename it and alias the current name with a deprecation. Obviously not here, but I opened π Rename view all revisions entity access operation to view revision overview Active
While doing so, I noticed that route access is currently also not checking both for a single revision route, so we are in fact already treating them completely separate, and then IMHO we can remove the call here as well? See \Drupal\Core\Entity\Routing\RevisionHtmlRouteProvider::getRevisionRevertRoute.
- last update
about 1 year ago 30,489 pass - last update
about 1 year ago 30,489 pass - Status changed to Needs work
about 1 year ago 5:09am 7 November 2023 - π¨πSwitzerland berdir Switzerland
The last paragraph in #25 was meant more as a comment on the operation name discussion, but yes, considering that route access it would be consistent to leave it out here as well and I think secure to I.
- π¦πΊAustralia acbramley
@Berdir can you confirm exactly what you're wanting removed? The check to
view all revisions
operation in the field access? - π§πͺBelgium BramDriesen Belgium π§πͺ
Fixed a typo and made the IS a tiny bit more structured
- π¨πSwitzerland berdir Switzerland
> @Berdir can you confirm exactly what you're wanting removed? The check to view all revisions operation in the field access?
Yes, I think we can skip that, because that's consistent with how access to the single-revision route works as well, it doesn't check all either.
- Status changed to Needs review
about 1 year ago 10:12pm 14 November 2023 - π¦πΊAustralia acbramley
@Berdir went to implement that, but it falls over immediately for BlockContent. We don't have a
view revision
operation. Editors who can see the list of revisions for block content should be able to see the revision logs. I think this is potentially enough to justify keeping it the way it is. Not every entity type has a view/view revision route, but may have a version history which displays the revision log. - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
Could we special case block content (via it's access control handler) and keep the others lean?
- π¨πSwitzerland berdir Switzerland
No strong opinion and don't want to block on that, but yes, just adding an extra case for that operation like MediaAccessControlHandler does might be an option?
- Status changed to Needs work
about 1 year ago 12:06am 15 November 2023 - π¦πΊAustralia acbramley
Merging with upstream has broken the Media based tests because we now have a functioning media revision UI
- Status changed to Needs review
about 1 year ago 12:57am 15 November 2023 - Status changed to RTBC
about 1 year ago 2:55pm 17 November 2023 - πΊπΈUnited States smustgrave
β¨ Add view tab + standard template for block content Needs work this is on my list (maybe this weekend) so hopefully block_content being that one off won't be an issue
But appears all threads have been addressed.
- last update
about 1 year ago 30,573 pass, 1 fail - Status changed to Needs work
about 1 year ago 8:42pm 17 November 2023 - Status changed to Needs review
about 1 year ago 11:13pm 19 November 2023 - π¦πΊAustralia acbramley
Actioned all feedback, fixed conflict, hopefully no more random test fails :)
- Status changed to RTBC
about 1 year ago 12:50am 20 November 2023 - πΊπΈUnited States smustgrave
Appears all threads have been resolved.
- last update
about 1 year ago 30,607 pass 16:38 12:10 Running- last update
12 months ago 30,670 pass -
longwave β
committed 04c5013c on 10.2.x
Issue #3395404 by acbramley, larowlan, smustgrave, Berdir, jannakha, xjm...
-
longwave β
committed 04c5013c on 10.2.x
-
longwave β
committed 184f22ee on 11.x
Issue #3395404 by acbramley, larowlan, smustgrave, Berdir, jannakha, xjm...
-
longwave β
committed 184f22ee on 11.x
- Status changed to Fixed
12 months ago 11:30am 25 November 2023 - π¬π§United Kingdom longwave UK
Committed and pushed 184f22eef0 to 11.x and 04c5013c3c to 10.2.x. Thanks!
As a security hardening this is eligible for backport to 10.1.x but it didn't apply cleanly due to π BlockContentAccessControlHandler requires access block library permission for update, delete and revisions operations Fixed . Looking at the conflict I am not sure it is worth attempting now, if someone wants to add this in 10.1.x then feel free to open a new MR.
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
11 months ago 1:02am 20 December 2023 - π¦πΊAustralia acbramley
This has some interesting side effects wrt. cacheability.
If you have json:api requests without the fields query param (i.e get all the fields for an entity) then you may now get UNCACHEABLE responses.
This is because we now check entity update access when checking field access for the revision log, which for quite a few entity types includes the user cache context (e.g microcontent, media)
Weirdly, we were running a version of this patch on 10.1 which had the same effect (returning a $result from checkFieldAccess that container the user cache context) but for whatever reason that context didn't get bubbled to the end response.
Now on 10.2, probably due to an unrelated bug fix, that cache context correctly bubbles up and makes the response uncacheable in dynamic page cache (DPC)