🇰🇷 한글 설명
Magistrala 1.0.0 미만 버전의 timescale-reader 및 postgres-reader HTTP API 서비스에서 SQL 인젝션 취약점이 발견되었습니다. 인증된 공격자가 악의적인 format 쿼리 파라미터를 사용하여 데이터베이스에 임의의 SQL을 주입할 수 있으며, 이를 통해 타 테넌트 데이터 탈취, 비밀번호 해시 추출, 파일 읽기/쓰기 및 OS 명령 실행이 가능합니다.
💡 쉬운 설명
로그인한 사용자가 특수한 명령어를 입력하여 데이터베이스를 마음대로 조작할 수 있는 보안 결함입니다. 해커가 이 취약점을 이용하면 다른 사용자의 정보를 훔치거나 서버 자체를 장악할 수 있습니다.
🇺🇸 원문 (English)
Magistrala before 1.0.0 contains a SQL injection vulnerability in the timescale-reader and postgres-reader HTTP API services that allows authenticated attackers to inject arbitrary SQL by supplying a malicious format query parameter that is interpolated directly into the FROM clause without parameterization or identifier quoting. Attackers with a self-registered account can substitute arbitrary subqueries to achieve cross-tenant database reads, extract pg_shadow password hashes, read and write arbitrary files, and execute arbitrary code as the postgres OS user by loading attacker-supplied shared objects, with all injected SQL executing at superuser privilege due to the default PostgreSQL role configuration.
📍 영향받는 시스템
Magistrala version < 1.0.0
⚔️ 공격 벡터
인증된 사용자가 HTTP API의 format 쿼리 파라미터에 악의적인 SQL 구문을 삽입하여 공격
🛡️ 대응 방법
Magistrala를 1.0.0 이상의 최신 버전으로 업데이트하고 데이터베이스 권한 설정을 최소화하십시오.
🔧 검증 코드
명령어 결과로 VULNERABLE이 출력되면 취약한 버전이 설치된 것이며, 아무것도 출력되지 않으면 안전합니다.
magistrala --version 2>/dev/null | grep -E '^[0-9]+\.[0-9]+\.[0-9]+' | awk -F. '$1" ."$2" ."$3 < 1.0.0 {print "VULNERABLE"}'