Skip to content

Commit

Permalink
Update path_traversal.yaml
Browse files Browse the repository at this point in the history
  • Loading branch information
sebasrevuelta authored Nov 7, 2024
1 parent 7e7b76b commit 056bef7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions njsscan/rules/semantic_grep/traversal/path_traversal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ rules:
$X.readFileAsync(..., <... $INP ...>, ...)
message: >-
Untrusted user input in createReadStream()/readFile()/readFileSync()/readFileAsync() can end up in Directory Traversal Attack.
A Directory Traversal Attack (also known as Path Traversal Attack) is a type of security vulnerability that occurs when an attacker is able to access files or directories on a server that are outside the intended directory structure. This attack leverages insufficient validation or sanitization of user inputs in applications that interact with the file system.
Strictly validate user inputs. Ensure that user-supplied paths do not include sequences like ../ or ..\\ that could traverse directories.
In Node.js, use the path module to safely handle and resolve file paths. The path.normalize() function can be used to ensure that paths do not go outside the intended directory.
A Directory Traversal Attack (also known as Path Traversal Attack) is a type of security vulnerability that occurs when an attacker is able to access files or directories on a server that are outside the intended directory structure. This attack leverages insufficient validation or sanitization of user inputs in applications that interact with the file system.
Strictly validate user inputs. Ensure that user-supplied paths do not include sequences like ../ or ..\\ that could traverse directories.
In Node.js, use the path module to safely handle and resolve file paths. The path.normalize() function can be used to ensure that paths do not go outside the intended directory.
languages:
- javascript
severity: ERROR
Expand Down

0 comments on commit 056bef7

Please sign in to comment.