Active
Project:
Drupal core
Version:
main
Component:
user system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Aug 2019 at 15:50 UTC
Updated:
6 Feb 2025 at 18:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
samuel.mortensonComment #3
samuel.mortensonComment #4
xjmComment #5
otrolopezmasHi. In this patch I added
restrict access: truetoo all permissions mentioning Administer inside core.I left out the following, inside field_ui.permissions.yml, since Administer is not mentioned in the title (just in the name). Should it be included?
Comment #6
otrolopezmasComment #7
gregglesPhilosophically, we should only add this attribute to permissions where a user who has that permission can take over a site.
For example: a user with "administer permissions" is going to be able to take over the site by the nature of that permission.
In contrast, "Administer book outlines" is a permission where nothing in the nature of the permission means that it makes the whole site vulnerable.
I think we should use the `restrict access: true` attribute minimally and only where appropriate regardless of the word in the permission.
Comment #8
jungleI do agree with @greggles personally.
And is it necessary to restrict test modules? For example, the field_test module like the above. Modules for testing are hidden by default. No one will see the warning in general.
I'd vote to no.
Comment #9
otrolopezmasIt's clear, I just followed the proposed resolution literally. What about things like
administer blocksoradminister languages, usually you will not be able to take over the site but it can be harmful.I will create another patch with the right options.
Comment #10
shimpyAs per my knowledge in Drupal. I have identified some major things or modules where it is mandatory to put the warnings for giving the permission for other users. Additionally i am posting the updated patch and PDF where i am identifying the modules. Please check for the same.
Comment #11
shimpyComment #12
shimpyComment #13
shimpyI have updated the patch with the required module administer warnings as per my knowledge. Along with the edited module list below
1Aggregator - Permissions enabled
2 Block - Permissions enabled
3 Book Outlines -Not Required
4 Comment and Comment Settings -Permissions enabled
5 Contact forms -Permissions enabled
6 Content Translation -Permissions enabled
7 Field Test - Not Required
8 Forum -Permissions enabled
9 Image -Permissions enabled
10 Language -Permissions enabled
11 Responsive Image -Permissions enabled
12 Search -Permissions enabled
13 Shortcut -Permissions enabled
14 Statistics -Not Required
15 System -Permissions enabled
16 System_test- Not Required
17 Entity_test- Not Required
18 Taxonomy -Permissions enabled
19 Workspaces -Permissions enabled
Comment #14
dhirendra.mishra commentedWe will picking this in vb_global_contribution_hour1
Comment #15
dhirendra.mishra commentedComment #16
jungleNo newline at end of file
No newline at end of file
No newline at end of file
No newline at end of file
No newline at end of file
redundant leading spaces below restrict access: true
Comment #17
shimpy@jungle Please review the patch now after corrections
Comment #18
jungleLooks good for me. Thanks @shimpy!
Comment #19
gregglesThanks, all, for your continued work on this!
With each of these, I think we should ask: "Does this permission inherently allow someone to "take over" the site?" If not, then we should not add the `restrict access: true` property to it. Adding that property to too many permissions makes it seem less serious. If an admin has to say "Well, I trust this person enough to administer forums which has that risky property on it, maybe I should also trust that role for administering users."
Here are a few that are in patch #14 and giving me doubts about adding the restrict access property:
title: 'Administer news feeds'
title: 'Administer blocks'
title: 'Administer comments and comment settings'
title: 'Administer contact forms and contact form settings'
title: 'Add, edit, and delete custom display modes.'
title: 'Administer forums'
title: 'Administer image styles'
title: 'Administer languages'
title: 'Administer URL aliases'
title: 'Administer responsive images'
title: 'Administer search'
title: 'Administer shortcuts'
title: 'Administer themes'
title: 'Administer menus and menu items'
title: 'Administer vocabularies and terms'
title: Administer workspaces
All of those above permissions seem like they allow for seriously altering the way a site looks and behaves. At least they would allow someone to dramatically alter a section of the site (news feeds, display modes, forums, vocabularies and terms). Some would let an admin dramatically alter the whole site (blocks, themes, menus). Some would be very useful in a social engineering attack (URL aliases, contact forms). I'm not sure that the ability to administer forums should really be considered as a permission with the same risk as administer users.
Here's one that seems like it's nature would allow for causing so much damage to a site that it could probably let someone take over a site (e.g. disabling security modules, enabling modules that create weaknesses in a site like a php-execution module).
title: 'Administer modules'
I do think that administer modules should have restrict access set to true.
Before making a new patch we might want to have some discussion about these individual permissions to decide which are inherently risky.
Comment #20
samuel.mortensonOne point I made in chat that I'll bring up here is that even if an "Administer" permission isn't dangerous now, it could become dangerous when combined with contrib modules or future core versions.
For example, a contrib-provided block that allows you to enter raw HTML but trusts the "Administer blocks" permission may expect that permission to be trusted.
"Add, edit, and delete custom display modes" combined with something like Display Suite or Field Group may allow users to construct malicious HTML (you can customize wrapping classes and attributes with those modules).
Maybe it would help to change the warning to "Warning: Give to trusted roles only; this permission *may have* security implications.", or simply "Warning: Give to trusted roles only", the permissions.yml key is "restrict access" which doesn't make it seem explicitly security related, I think we should warn users about granting administrator permissions to any untrusted role.
Comment #21
iyyappan.govindHi @greggles
Agreed with your point. Because we shouldn't give me permission restrictions for blocks. In my project we have given administer blocks to editor. So we don't want restriction warning for the administer blocks
Comment #22
mcdruid commentedI agree with the general idea that overuse of "restrict access" risks "debasing the currency" to the point where it becomes somewhat meaningless.
A freshly installed D8 site currently has 98 different permissions as far as I can see, of which 40 begin with "administer". There are 23 permissions currently marked as "restricted", and not all of these include "administer" in their name.
If we add all the other "administer" permissions:
So that's now close to half of all the permissions in the system. I think it'd be good to avoid ending up with half of core's permissions marked as restricted.
On the other hand, @samuel.mortenson makes a good point about contrib code perhaps making assumptions about "administer" permissions, and I think it's generally implied that these should only be assigned to "trusted" roles.
We've certainly dealt with a few security issues recently where an "administer"-type permission allows unfiltered HTML but is not marked as restricted, and we've had some debate about whether marking the permission as restricted is the correct "fix" in this situation (there are a few recent contrib SAs we could reference here).
To think the implications through, I suppose we need to ask:
@greggles mentioned considering:
...which I agree is a useful yardstick. What does "take over" mean though? Does that include, for example, being able to perform XSS because you can enter unfiltered HTML?
Looking at the list of "administer" permissions which are not (yet) marked as restricted:
... we can probably come up with malicious things that most of them would allow a bad actor to do.
Are there any which we could consider "mostly harmless"? Perhaps "administer image styles" and most of the "administer $something display"?
(This list's not exhaustive as it doesn't include permissions from modules which are not enabled by default; e.g. "Administer forums".)
There are definitely a few on the list which are powerful enough that they should be marked as restricted if the criteria for that is allowing a site to be "taken over" maliciously; e.g. administer blocks, modules, menu.
Comment #24
jungleComment #31
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.
Comment #33
quietone commentedComment #34
quietone commentedComment #35
akalata commentedResearch
I've taken a fresh look at existing 11.x
restricted accesspermissions to get a sense of the existing categories where a permission has been considered worth this warning level.Site building and maintenance
As somebody who builds sites for clients, this is all in the list of things I generally would not want them to be able to do for fear of breaking things, even unintentionally.
However, I'm not sure that I could back up all of these as having "security implications" without being so broad as to then need to flag all of the
administer [entity_type] displayandadminister [entity_type] form displaypermissions as well.User management
It's important for site owners to be able to manage their own users, and having the warning messages here helps to reinforce how important it is that user roles and permissions are handled thoughtfully.
Access overrides
A webmaster or designated content administrator should be able to bypass access controls that are in place for users with lower levels of access.
Information disclosure
Pages that provided detailed system information should be protected in order to prevent malicious actors from gaining information about the specific software version(s) used by the site, or to information disclosed in error logs.
Other notes
The permissions for individual filter formats now have a specific warning: "This permission may have security implications depending on how the text format is configured."
Proposal
Using the above as guidelines, here are the permissions I suggest adding to the
restrictedlist.Access
administer workspacesmeets the "administer [entity_type] entities" criteriaadminister blocksmeets the "administer [entity_type] entities" criteriaadminister commentsmeets the "administer [entity_type] entities" criteriaadminister contact formsmeets the "administer [entity_type] entities" criteriaview any unpublished contentmeets the "bypass access control" criteriaban IP addressescould arguably fall into this category as it could do the opposite -- prevent site owners from being able access their site completelyInformation disclosure
administer modulesallows access to the module list page, which shows enabled versionsview update notificationsdisplays module versions and specifically highlights out-of-date modules