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

  1. Install ai_disclosure, which installs the report at /admin/reports/ai-disclosure.
  2. Create a node with status: 0 and a distinctive title.
  3. Create a user whose only permissions are access content and access ai disclosure report.
  4. As that user, request the unpublished node. It is 403.
  5. Open /admin/reports/ai-disclosure. Its title, content type, grade and change time are listed.
  6. Enable ai_disclosure_csv_export and 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.