Security: the disclosure report lists unpublished content to anyone holding its view permission
Summary
The shipped ai_disclosure_report view has a node_field_data base table and no published-status filter, and node access grants alone do not remove unpublished rows. A user whose only extra permission is access ai disclosure report, which has no description and is not restrict access: TRUE, sees the titles and change times of content they get a 403 on.
Reproduction steps
- Install ai_disclosure, which installs the report at
/admin/reports/ai-disclosure. - Create a node with
status: 0and a distinctive title. - Create a user whose only permissions are
access contentandaccess ai disclosure report. - As that user, request the unpublished node. It is 403.
- Open
/admin/reports/ai-disclosure. Its title, content type, grade and change time are listed. - Enable
ai_disclosure_csv_exportand request/admin/reports/ai-disclosure/export. The same row is in the CSV.
Possible fixes
Add core's status_extra filter to the view's default display. It shows unpublished rows only to users who may see them, and needs no code.
If the report is meant to cover unpublished content, keep the rows and say so on the permission: give it a description naming that, and consider restrict access: TRUE.
Disclosure
AI was used to find this issue, verify it against a running site, and write this report. A human rewrote it.