hardening: check path for unexpected directories warning: revamp