2022-12-22 10:59:18 +00:00
|
|
|
id: generic-path-traversal
|
|
|
|
|
|
|
|
info:
|
2023-07-02 17:40:27 +00:00
|
|
|
name: Generic - Path Traversal
|
2022-12-22 10:59:18 +00:00
|
|
|
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
|
2022-12-22 11:36:43 +00:00
|
|
|
matchers:
|
2022-12-22 10:59:18 +00:00
|
|
|
- type: regex
|
|
|
|
regex:
|
2023-06-28 05:11:36 +00:00
|
|
|
- "[^\\.]*\\.createReadStream\\([^\\)]*\\, <[\\s\\S]*?\\> [^\\)]*\\)"
|
|
|
|
- "[^\\.]*\\.readFile\\([^\\)]*\\, <[\\s\\S]*?\\> [^\\)]*\\)"
|
|
|
|
- "[^\\.]*\\.readFileSync\\([^\\)]*\\, <[\\s\\S]*?\\> [^\\)]*\\)"
|
|
|
|
- "[^\\.]*\\.readFileAsync\\([^\\)]*\\, <[\\s\\S]*?\\> [^\\)]*\\)"
|
2023-10-14 11:27:55 +00:00
|
|
|
condition: or
|
2023-10-20 11:41:13 +00:00
|
|
|
|
|
|
|
# digest: 4b0a00483046022100e21a018d792fd5746301590fee7667c09666ad26347732653bdf90db09245f150221008bddd8b9b51c116885885104f24ed7cda9f5ba500680a85415390a22c4584a8b:922c64590222798bb761d5b6d8e72950
|