cbcvebase.
CVE-2021-32820
published 2021-05-14

CVE-2021-32820: Express-handlebars is a Handlebars view engine for Express. Express-handlebars mixes pure template data with engine configuration options through the Express…

PriorityP266high8.6CVSS 3.1
AVNACLPRNUINSCCHINAN
EXPLOIT
EPSS
17.99%
96.8th percentile
Express-handlebars is a Handlebars view engine for Express. Express-handlebars 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 extentions (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.

Affected

3 ranges
VendorProductVersion rangeFixed in
express-handlebarsexpress-handlebars<= 5.3.2
express-handlebarsexpress-handlebars>= 0 < 5.3.15.3.1
express_handlebars_projectexpress_handlebars<= 5.3.2

Detection & IOCsextracted from sources · hover to see the quote

url{{BaseURL}}/?layout=/etc/passwd
path/etc/passwd
  • The `layout` query parameter is the attack vector. Monitor GET requests where `layout` is set to an absolute path (e.g., /etc/passwd) or a path-traversal sequence targeting files with extensions.
  • Only files with an existing extension can be included directly. Files without an extension will have `.handlebars` appended automatically — attackers must target files that already carry an extension.
  • A successful exploitation returns HTTP 200 with the raw file content in the response body. Correlate a 200 status with /etc/passwd-style content patterns (root:.*:0:0:) to confirm exploitation.
  • ·The vulnerability is in how Express-handlebars mixes template data with engine configuration options via the Express render API — the `layout` parameter is passed directly to the file-inclusion logic without sanitisation.
  • ·Exploitation scope is partially restricted: only files that already carry a file extension can be disclosed. Extensionless targets are silently suffixed with `.handlebars`, limiting but not eliminating the attack surface.

CVSS provenance

nvdv3.18.6HIGHCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
nvdv2.05.0MEDIUMAV:N/AC:L/Au:N/C:P/I:N/A:N
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.