Combine analysis methods around the CWE-59 resource boundary
MITRE identifies automated static analysis, manual source review, dynamic analysis as applicable detection approaches. Use them to find privileged file operations that resolve attacker-influenced pathnames more than once or follow links outside a trusted directory, and prove checks apply to the same opened object that is ultimately used. Require a reproducible trace from attacker influence to the unsafe behavior, record coverage gaps, and confirm suspected findings dynamically where safe; no single technique establishes complete coverage.
CWE-59: detection methods and operational guidance — MITRE CWE