Access checks on the audit export and the restore

Problem/motivation

Found in the security review before 1.0.0-beta2, on code that is not released yet.

  • The audit files of the uninstall page need only administer ai disclosure. They hold the suggestion notes, which the suggestions file hides without access ai disclosure suggestions.
  • The restore page writes to any entity that has the field. It does not check that the user may update it.
  • The uploaded file has no size limit and no extension check.
  • The check and the Drush import keep every loaded entity in memory.

Proposed resolution

  • The audit files need purge ai disclosure audit, and the audit records file also needs access ai disclosure suggestions.
  • In the browser, rows of entities the user cannot update are skipped and counted. Drush keeps writing them.
  • Accept only .csv files up to 10 MB.
  • Reset the entity cache after each row.

AI Compliance

🤖 Generated with the help of an LLM, reviewed and approved by me before posting.