This issue was addressed with improved checks. This issue is fixed in iOS 18.0.1 and iPadOS 18.0.1. Audio messages in Messages may be able to capture a few seconds of audio before the microphone indicator is activated.
https://securityaffairs.com/169381/mobile-2/apple-ios-18-0-1.html
https://www.theregister.com/2024/10/04/apple_voiceover_password_bug/