resolve a path against malicious attacks