Skip to content

Commit 4d921a2

Browse files
committed
Update README.md
1 parent 93bb273 commit 4d921a2

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Path Manipulation/README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,15 @@ You can use this repo as reference to fix the Path Manipulation issue [CWE-22](h
1111

1212
## Mitigation
1313

14-
Path Manipulation can be mitigated by validating the filename, folder name and extension validation and use the values further in the code only after the validations.
14+
🔍 Proper validation and strict controls over file operations are essential to prevent these threats!
15+
16+
✅Validate Filename: Disallow dot character (“.”), percentage character (“%”), slash character (“/”) and/or back slash characters (“\”) and other special characters.
17+
18+
✅Extension Whitelist: Add validation to allow only whitelisted extensions.
19+
20+
✅Limit File Size: Only allows files within your allowed range.
21+
22+
✅Unique Filename Validation: Prevent overwriting the existing files on the server.
1523

1624
## NOTE
1725
The code for the Path Manipulation only check for the Filename validation, Extension Validation, File Size Validation, Unique Filename Validation. ***It doesn't check for the File Contents and Magic Numbers. Use this logic when you are concerned about the Path Manipulation issue ONLY***.

0 commit comments

Comments
 (0)