4 ms·
The most obvious rationale for this sort of thing is limiting what an attacker can do after injecting and running their own code in the process. (Straight Morri
by rst 7y ago
The most obvious rationale for this sort of thing is limiting what an attacker can do after injecting and running their own code in the process. (Straight Morris-worm style buffer overflow attacks are hard to execute these days, but there are more sophisticated variations on the theme which still often work.)
There are other attacks which can also be mitigated by this sort of thing. A common attacker trick is supplying paths with a lot of '../../../..' embedded, to trick the program into accessing (and potentially leaking the contents of) parts of the filesystem that a remote attacker isn't supposed to have access to. (Citrix web appliances were recently subject to a particularly nasty version of this attack, cataloged as CVE-2019-19781, leading to full compromise.) Using 'unveil()' to limit the scope of filesystem access is a viable mitigation strategy...