The issue was addressed with improved UI handling. This issue is fixed in macOS Sonoma 14.6, Safari 17.6, macOS Monterey 12.7.6, macOS Ventura 13.6.8. Visiting a website that frames malicious content may lead to UI spoofing.
https://support.apple.com/en-us/HT214118
https://support.apple.com/kb/HT214121
https://support.apple.com/en-us/HT214121
https://support.apple.com/en-us/HT214120
https://support.apple.com/en-us/HT214119
http://seclists.org/fulldisclosure/2024/Jul/20
http://seclists.org/fulldisclosure/2024/Jul/19