🇰🇷 한글 설명
Rucio의 FilterEngine.create_sqla_query() 메서드에서 SQL injection 취약점이 존재하여 인증된 사용자가 DID 검색 API를 통해 Oracle 데이터베이스에 임의의 SQL 명령을 실행할 수 있습니다. 공격자는 인증 토큰, 비밀번호 해시, 관리 데이터 식별자 등 민감한 정보를 탈취하거나 데이터베이스 내용을 수정할 수 있습니다.
💡 쉬운 설명
Rucio의 검색 기능에서 특수한 문자를 입력하면 데이터베이스를 직접 조작할 수 있는 보안 결함입니다. 시스템에 접근 권한이 있는 사용자라면 누구나 암호나 중요한 데이터를 빼낼 수 있습니다.
🇺🇸 원문 (English)
A SQL injection vulnerability in `FilterEngine.create_sqla_query()` allows any authenticated Rucio user to execute arbitrary SQL against the backend database through the DID search endpoint (`GET /dids/<scope>/dids/search`). On Oracle deployments attacker-controlled filter keys and values are interpolated directly into `sqlalchemy.text()` via Python `.format()`, completely bypassing parameterization. This enables full database compromise including extraction of authentication tokens, password hashes, and all managed data identifiers. This affects versions 1.27.0 and later before 35.8.5, 38.5.5, 39.4.2, and 40.1.1.
The vulnerability exists in `lib/rucio/core/did_meta_plugins/filter_engine.py` within the `create_sqla_query()` method. When the database dialect is Oracle, filter expressions for JSON metadata columns are constructed using `text()` with Python string formatting. Both `key` and `value` are attacker-controlled strings derived from HTTP query parameters. The `text()` function creates a raw SQL fragment — it does **not** escape or parameterize its contents.
Any authenticated Rucio user can exploit this through the DID search API to execute arbitrary SQL against the backend database. This can expose all managed data identifiers and sensitive tables such as identities, tokens, accounts, rse_settings, and rules, and may allow modification of database contents. The issue affects Oracle deployments using the default json_meta plugin and does not affect PostgreSQL or MySQL deployments using that plugin.
This vulnerability has been fixed in versions 35.8.5, 38.5.5, 39.4.2, and 40.1.1.
📍 영향받는 시스템
Rucio 1.27.0 이상 35.8.5 미만, 38.0~38.5.4, 39.0~39.4.1, 40.0~40.1.0 (Oracle 데이터베이스만 영향)
⚔️ 공격 벡터
인증된 사용자가 GET /dids/<scope>/dids/search 엔드포인트의 필터 파라미터에 SQL 코드를 주입
🛡️ 대응 방법
Rucio를 35.8.5, 38.5.5, 39.4.2, 40.1.1 이상으로 업그레이드
🔧 검증 코드
출력된 버전이 영향받는 버전 범위에 포함되면 취약하며, 권장 버전 이상이면 패치됨
pip show rucio 2>/dev/null | grep Version || rpm -q rucio 2>/dev/null || dpkg -l | grep rucio