Sure, you should be able to use the AttachmentExtensionMatchesWords condition, as detailed for example here: https://learn.microsoft.com/en-us/exchange/security-and-compliance/mail-flow-rules/inspect-message-attachments#inspect-the-file-properties-of-attachments
Though the common attachment filter under Malware policies is probably a better place to enforce this.
Hi, I'm here to confirm with you if your issue has been resolved. If the problem is successfully solved, you can share your solution and mark them or the helpful reply as answer, this will make answer searching in the forum easier and be beneficial to other community members as well.