2022-12-22 10:54:01 +00:00
|
|
|
id: zip-path-overwrite
|
|
|
|
|
|
|
|
info:
|
|
|
|
name: Zip Path Overwrite
|
|
|
|
author: me_dheeraj (https://twitter.com/Dheerajmadhukar)
|
|
|
|
severity: info
|
2023-06-28 05:06:23 +00:00
|
|
|
description: Insecure ZIP archive extraction can result in arbitrary path overwrite and can result in code injection.
|
2022-12-22 10:54:01 +00:00
|
|
|
tags: file,nodejs
|
|
|
|
file:
|
|
|
|
- extensions:
|
|
|
|
- all
|
2022-12-22 11:37:04 +00:00
|
|
|
matchers:
|
2022-12-22 10:54:01 +00:00
|
|
|
- type: regex
|
|
|
|
regex:
|
2023-06-28 05:06:23 +00:00
|
|
|
- "require\\('unzip'\\)"
|
|
|
|
- "require\\('unzipper'\\)"
|
|
|
|
- "[\\w\\W]+?\\.pipe\\([\\w\\W]+?\\.Parse\\([\\w\\W]*?\\)\\)\\.on\\('entry', function [\\w\\W]*?\\([\\w\\W]*?\\) \\{"
|
|
|
|
- "[\\w\\W]+? = [\\w\\W]+?\\.indexOf\\([\\w\\W]*?\\)"
|
|
|
|
- "[\\w\\W]+?\\.pipe\\([\\w\\W]+?\\.createWriteStream\\([\\w\\W]*?\\)\\)"
|
|
|
|
- "[\\w\\W]+?\\.pipe\\([\\w\\W]+?\\.writeFile\\([\\w\\W]*?\\)\\)"
|
|
|
|
- "[\\w\\W]+?\\.pipe\\([\\w\\W]+?\\.writeFileSync\\([\\w\\W]*?\\)\\)"
|
|
|
|
- "[\\w\\W]+?\\.Parse\\([\\w\\W]*?\\)\\.on\\('entry', function [\\w\\W]*?\\([\\w\\W]*?\\) \\{"
|
|
|
|
- "[\\w\\W]+?\\.createWriteStream\\([\\w\\W]*?\\)"
|
|
|
|
- "[\\w\\W]+?\\.writeFile\\([\\w\\W]*?\\)"
|
|
|
|
- "[\\w\\W]+?\\.writeFileSync\\([\\w\\W]*?\\)"
|
2022-12-22 10:54:01 +00:00
|
|
|
condition: or
|
2023-10-19 13:13:52 +00:00
|
|
|
# digest: 4a0a00473045022047f3632b4b629a718f03f122923ecb7a440173d05eff63495de945c7eecaa959022100c898c664cdbf7a53469f2d4f41fb76df1580af59737082875247e0e42a4d70c8:922c64590222798bb761d5b6d8e72950
|