Create tar-path-overwrite.yaml

patch-1
Prince Chaddha 2022-12-22 16:27:38 +05:30 committed by GitHub
parent 2328a044b2
commit a3be11f92d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
id: tar-path-overwrite
info:
name: Tar Path Overwrite
author: me_dheeraj (https://twitter.com/Dheerajmadhukar)
severity: info
description: Insecure TAR archive extraction can result in arbitrary path over write and can result in code injection.
tags: file,nodejs
file:
- extensions:
- all
extractors:
- type: regex
regex:
- "\\$X = require\\('tar-stream'\\)"
- "\\$EXTRACT\\.on\\('entry', function \\$FUNC\\(...\\) {"
- "\\$FS\\.createWriteStream\\(\\$FIL, ...\\)"
- "\\$FS\\.writeFile\\(\\$FIL, ...\\)"
- "\\$FS\\.writeFileSync\\(\\$FIL, ...\\)"
condition: or