Problem/Motivation
Url::access() doesn't bubble cacheability metadata, and consequently could lead to security vulnerabilities in case developers fail to take this into account.
See #2661200-52: Make admin/help page more flexible, and list tours on it's interdiff-url-changes.txt for an initial patch.
Proposed resolution
Make it bubble cacheability metadata.
Remaining tasks
TBD
User interface changes
None.
API changes
TBD
Data model changes
None.
| Comment | File | Size | Author |
|---|---|---|---|
| #21 | 2677902-nr-bot.txt | 150 bytes | needs-review-queue-bot |
| #6 | url_access_doesn_t-2677902-6.patch | 6.36 KB | willzyx |
Issue fork drupal-2677902
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
xjmSo what are the implications of this? Can we update the summary from whatever information is relevant on the other (lengthy) issue?
Also, just to confirm, this was not actually committed as part of #2661200: Make admin/help page more flexible, and list tours on it?
Comment #3
catchWasn't committed as part of #2661200: Make admin/help page more flexible, and list tours on it
Comment #4
wim leersThe implications are now in the IS.
Comment #6
willzyx commentedlet's try with the patch provided in #2661200-52: Make admin/help page more flexible, and list tours on it interdiff-url-changes.txt
Comment #7
dawehnerI'm wondering whether a dedicated method like
->accessResult()would be actually a better approach. We then could mark access() as deprecated, and let people always explicitly thing about what they want to do.Isn't that a BC break?
Comment #15
mxr576bump
Totally agree, developers must be aware that they are working with an object that provides cacheability information which must be bubbled up if they rendering an URL on the web UI.
Comment #16
dawehnerI do agree a separate method would be great, but I wonder whether introducing this just on the URL object is the right approach. There are tons of places with a parameter to decide whether an object or a boolean should be returned.
Maybe it would be possible for Drupal 10 to just remove the $return_as_object in case https://wiki.php.net/rfc/objects-can-be-falsifiable is available?
Comment #21
needs-review-queue-bot commentedThe Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".
Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.
Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.