Problem/Motivation
Some popular contrib modules (e.g. webform) provide views without permission checks.
There is a request to add access checks to webform but the discussion in #2499029: Add Default Views access control is not finished (last comment two years ago).
So I think a possibility to whitelist whole views or view displays would be quite nice.
There is a similiar issue #2687099: Webform 4 default Views triggering Views access warning for the 7.x branch with a patch but I think for 3.0.x we should use the setting mechanism already provide by security review.
Other modules providing views without access check are commerce and profile (see #3259261: Missing Views access restrictions according to Security Review module)
Steps to reproduce
Enable webform and security review's "Views access" check. Run the check and you'll get a failure "Webform submissions: default".
Proposed resolution
- Add settings to ignore whole views (view_name) or displays (view_name:display_name) - similiar to TrustHostSettings and the proposal in #2678112: Make fields check more useful with risky content (allowlist of content?).
- Ignore those values in ViewsAccess::run().
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
No real data model changes but new config settings for ignores.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | security_review-whitlist-views-3216263.patch | 2.31 KB | gngn |
| #2 | security_review-whitelist-views-3216263-2-d8.patch | 2.69 KB | gngn |
Issue fork security_review-3216263
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
gngn commentedPatch as proposed above.
Comment #3
smustgrave commentedCan you see if https://www.drupal.org/project/security_review/issues/3224996 would address your issue? if not I think https://www.drupal.org/project/security_review/issues/1172090 will definitely.
Comment #4
smustgrave commentedClosing as outdated. If still an issue please test on 2.x branch and reopen please
Thanks!
Comment #5
gngn commentedI reopen this for 3.0.x because it is still an issue, I do not think the other modules are going to provide access checks and I really like to have a clean security review ;)
The patch is a bit smaller than the one provided for 8.x in #2 (mainly because we already have config for the views access check).
Like #2 you can enter whole views or distinct displays to ignore (i.e. "webform_submissions" or "webform_submissions:embed_default").
I also updated the description.
Comment #6
smustgrave commentedWill have to think about adding this one but fixes should be in MRs
Comment #8
gngn commentedI created a MR.
hope everything went OK (I'm still not used to MRs).
Comment #9
smustgrave commentedWill need to update schema + update hook.
Comment #10
smustgrave commentedFinally have test coverage for this plugin so we can land this feature.
Comment #16
smustgrave commentedComment #18
smustgrave commentedWant to try out on latest 3.1.x