Skip to main content

What it flags

A file path built from request data reaches fs, res.sendFile without root, res.download or res.render. path.basename and a containment check clear it. An anchored filename allowlist also clears it when the checker can prove the allowed characters and the validated value reaches the file operation unchanged. Exact Map.has(value) membership can establish a filename allowlist when the map has only portable literal keys and stays local and read-only. The value checked by has must be the component used in the path. The containment check compares paths lexically, including when an immutable local copy reaches the file operation. Filesystem identity also depends on directory entries such as symbolic links. Filesystem-aware evidence for shared writable directories is tracked separately in issue #683.

Configuration

Set the rule to "off" in loadwise.config.json to drop its findings: