🇰🇷 한글 설명
Firebird는 오픈소스 관계형 데이터베이스 관리 시스템입니다. 5.0.4, 4.0.7, 3.0.14 이전 버전에서는 외부 엔진 플러그인 로더가 사용자가 입력한 엔진 이름을 경로 구분자나 ..를 필터링하지 않고 파일시스템 경로에 연결합니다. CREATE FUNCTION 권한을 가진 인증된 사용자는 조작된 ENGINE 이름으로 경로 순회를 통해 임의의 공유 라이브러리를 로드할 수 있으며, 라이브러리 초기화 코드가 모듈 검증 전에 실행되어 서버 OS 계정 권한의 코드 실행이 가능합니다.
💡 쉬운 설명
데이터베이스에 함수를 만들 수 있는 권한이 있는 사용자가 특정 파일 경로를 조작해 서버에서 악성 프로그램을 실행할 수 있는 취약점입니다. 공격자는 이를 통해 데이터베이스 서버 전체를 장악할 수 있습니다.
🇺🇸 원문 (English)
Firebird is an open-source relational database management system. In versions prior to 5.0.4, 4.0.7 and 3.0.14, the external engine plugin loader concatenates a user-supplied engine name into a filesystem path without filtering path separators or .. components. An authenticated user with CREATE FUNCTION privileges can use a crafted ENGINE name to load an arbitrary shared library from anywhere on the filesystem via path traversal. The library's initialization code executes immediately during loading, before Firebird validates the module, achieving code execution as the server's OS account. This issue has been fixed in versions 5.0.4, 4.0.7 and 3.0.14.
📍 영향받는 시스템
Firebird 5.0.4 미만, 4.0.7 미만, 3.0.14 미만 버전
⚔️ 공격 벡터
CREATE FUNCTION 권한을 가진 인증 사용자가 ENGINE 이름에 경로 순회 문자열을 넣어 임의의 공유 라이브러리를 로드하여 코드 실행
🛡️ 대응 방법
Firebird를 5.0.4, 4.0.7, 3.0.14 이상 버전으로 업데이트하고, 불필요한 CREATE FUNCTION 권한을 회수
🔧 검증 코드
출력된 버전이 5.0.4, 4.0.7, 3.0.14 중 해당 브랜치의 패치 버전 이상이면 취약점이 해결된 것이며, 그 미만이면 즉시 업데이트가 필요합니다.
fbguard -z 2>/dev/null || (which isql-fb >/dev/null 2>&1 && isql-fb -z 2>/dev/null) || (dpkg -l firebird* 2>/dev/null | grep -E '^ii' || rpm -qa 'firebird*' 2>/dev/null)