I'm trying to understand what the noexec flag actually accomplishes. Does it prevent all executions originating from that file system? Or is it only ones that aren't in the bin folder?
In addition, let's say I manage to set exec as the default flag for all drives. Is there actually a risk that I could plug in a USB and it would automatically execute malicious code? Is this what noexec exists for, or is it only there to prevent users from doing stupid things with random executables?
This is different from the suggested duplicate as the duplicate does not explain whether there are security vulnerabilities associated with this practice.