The WordPress AI plugin exposes the ai/image-import ability through the WordPress Abilities REST API. The ability previously accepted a requester-controlled meta array and required the requester to have the upload_files capability, which the built-in Author role has by default.
After importing the image, the ability would write each supplied meta key/value pair directly to the newly-created attachment with update_post_meta(). Protected attachment meta keys were not blocked, so an Author could set their new attachment's _wp_attached_file value to the relative path of another user's uploaded media file.
If the Author deleted their own imported attachment, WordPress core resolves _wp_attached_file with get_attached_file() and would delete that file from the uploads directory. This would allow the Author delete another user's uploaded media file even though they cannot delete the victim attachment record.
AI version 1.0.2 has been released which fixed the problem by removing support for passing in arbitrary meta data when importing an image.
The WordPress AI plugin exposes the
ai/image-importability through the WordPress Abilities REST API. The ability previously accepted a requester-controlledmetaarray and required the requester to have theupload_filescapability, which the built-in Author role has by default.After importing the image, the ability would write each supplied meta key/value pair directly to the newly-created attachment with
update_post_meta(). Protected attachment meta keys were not blocked, so an Author could set their new attachment's_wp_attached_filevalue to the relative path of another user's uploaded media file.If the Author deleted their own imported attachment, WordPress core resolves
_wp_attached_filewithget_attached_file()and would delete that file from the uploads directory. This would allow the Author delete another user's uploaded media file even though they cannot delete the victim attachment record.AI version 1.0.2 has been released which fixed the problem by removing support for passing in arbitrary meta data when importing an image.