I found that an attacker can send a file with malicious link that can create a RCE through, even in notepad we are able to get the warning window but if in obsidian user has selected to always open links option he will not even get the any alerts while the codes gets executed.
For creating the POC I simply made this