Create admzip-path-overwrite.yaml

patch-1
Prince Chaddha 2022-12-22 16:55:24 +05:30 committed by GitHub
parent 419aebda71
commit cd2bc92191
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: admzip-path-overwrite
info:
name: Admzip Path Overwrite
author: me_dheeraj (https://twitter.com/Dheerajmadhukar)
severity: info
description: Insecure ZIP archive extraction using adm-zip can result in arbitrary path over write and can result in code injection.
tags: file,nodejs,admzip
file:
- extensions:
- all
matchers:
- type: regex
regex:
- "\\$X = require\\('adm-zip'\\)"
- "\\$ZIPENTZ\\.forEach\\(function \\$FUNC\\(\\$ENTRY, ...\\) {"
- "\\$FS\\.createWriteStream\\(...\\) }, ...\\)"
- "\\$FS\\.writeFile\\(...\\)"
- "\\$FS\\.writeFileSync\\(...\\) }, ...\\)"
condition: or