2022-12-22 11:26:45 +00:00
|
|
|
id: express-lfr
|
|
|
|
|
|
|
|
info:
|
2023-07-02 17:40:27 +00:00
|
|
|
name: Express - Local File Read
|
2022-12-22 11:26:45 +00:00
|
|
|
author: me_dheeraj (https://twitter.com/Dheerajmadhukar)
|
|
|
|
severity: info
|
|
|
|
description: Untrusted user input in express render() function can result in arbitrary file read if hbs templating is used.
|
|
|
|
tags: file,nodejs,express,lfr
|
|
|
|
file:
|
|
|
|
- extensions:
|
|
|
|
- all
|
|
|
|
matchers:
|
|
|
|
- type: regex
|
|
|
|
regex:
|
2023-06-28 05:22:51 +00:00
|
|
|
- "(\\$[\\w\\W]+?)\\.render\\(\\$[\\w\\W]+?, <[\\w\\W]+? \\\\$[\\w\\W]+? [\\w\\W]+? >\\)"
|
|
|
|
- "(\\$[\\w\\W]+?)\\.render\\(\\$[\\w\\W]+?, <[\\w\\W]+? \\\\$[\\w\\W]+?\\.\\$[\\w\\W]+? [\\w\\W]+? >\\)"
|
|
|
|
- "(\\$[\\w\\W]+?)\\.render\\(\\$[\\w\\W]+?, <[\\w\\W]+? \\\\$[\\w\\W]+? [\\w\\W]+? >\\)"
|
2022-12-22 11:26:45 +00:00
|
|
|
condition: or
|
2023-10-19 13:13:52 +00:00
|
|
|
# digest: 4b0a00483046022100e7798827d9cc0ed3a27739501621560cd2752e52aba95d220252540f0361afeb022100a8c14ce89e7beca1fb0c19891d37761ed32e3c096e6033a2c2d4a1b77f1a49f6:922c64590222798bb761d5b6d8e72950
|