id: generic-path-traversal info: name: Generic - Path Traversal author: me_dheeraj (https://twitter.com/Dheerajmadhukar) severity: info description: Untrusted user input in readFile()/readFileSync() can endup in Directory Traversal Attacks. tags: file,nodejs file: - extensions: - all matchers: - type: regex regex: - "[^\\.]*\\.createReadStream\\([^\\)]*\\, <[\\s\\S]*?\\> [^\\)]*\\)" - "[^\\.]*\\.readFile\\([^\\)]*\\, <[\\s\\S]*?\\> [^\\)]*\\)" - "[^\\.]*\\.readFileSync\\([^\\)]*\\, <[\\s\\S]*?\\> [^\\)]*\\)" - "[^\\.]*\\.readFileAsync\\([^\\)]*\\, <[\\s\\S]*?\\> [^\\)]*\\)" condition: or