I have a small project in this approximate area: https://www.kylheku.com/cgit/safepath/about/ safepath is a function which tries to analyze whether a path is safe to use. Roughly that means that it doesn't resolve in some way that can be controlled by another (non-root) user. A something similar to this is in TXR Lisp under the name path-components-safe: https://www.kylheku.com/cgit/txr/tree/stdlib/path-test.tl?hl...
Tho, to be fair, it's probably an improvement by narrowing how simple it is to exploit relative to doing nothing.