.. / CVE-2021-32820

Exploit for Express-handlebars - Local File Inclusion (CVE-2021-32820)

Description:

Express-handlebars is susceptible to local file inclusion because it mixes pure template data with engine configuration options through the Express render API. More specifically, the layout parameter may trigger file disclosure vulnerabilities in downstream applications. This potential vulnerability is somewhat restricted in that only files with existing extensions (i.e., file.extension) can be included. Files that lack an extension will have .handlebars appended to them. For complete details refer to the referenced GHSL-2021-018 report. Notes in documentation have been added to help users avoid this potential information exposure vulnerability.

Nuclei Template

View the template here CVE-2021-32820.yaml

Validate with Nuclei

echo "$URL" | nuclei -t ~/nuclei-templates/http/cves/2021/CVE-2021-32820.yaml
Copy

References:

https://github.com/detectify/ugly-duckling/blob/master/modules/crowdsourced/CVE-2021-32820.json
https://github.com/express-handlebars/express-handlebars/pull/163
https://nvd.nist.gov/vuln/detail/CVE-2021-32820
https://github.com/express-handlebars/express-handlebars/blob/78c47a235c4ad7bc2674bddd8ec2721567ed8c72/README.md#danger-
https://securitylab.github.com/advisories/GHSL-2021-018-express-handlebars/