🇰🇷 한글 설명
Tandoor Recipes는 NixOS 패키지 매니저로 설치 가능한 레시피 매니저인데, 버전 23.05부터 26.05 이전까지 기본 설정(SQLite, 기본 MEDIA_ROOT)을 사용할 경우 db.sqlite3 데이터베이스 파일이 인증 없이 HTTP를 통해 외부에 노출될 수 있습니다. 원인은 MEDIA_ROOT와 작업 디렉토리가 동일하게 /var/lib/tandoor-recipes로 설정되어 데이터베이스 파일이 일반 미디어 파일처럼 접근 가능한 것입니다.
💡 쉬운 설명
Tandoor Recipes 앱이 설정 오류로 데이터베이스 파일이 인터넷을 통해 누구나 다운로드할 수 있게 노출되었습니다. 악의적 사용자가 로그인 없이 모든 사용자 정보와 레시피 데이터에 접근할 수 있습니다.
🇺🇸 원문 (English)
Tandoor Recipes is a recipe manager than can be installed with the Nix package manager. Starting in version 23.05 and prior to version 26.05, when using the default configuration of Tandoor Recipes, specifically using SQLite and default `MEDIA_ROOT`, the full database file may be externally accessible, potentially on the Internet. The root cause is that the NixOS module configures the working directory of Tandoor Recipes, as well as the value of `MEDIA_ROOT`, to be `/var/lib/tandoor-recipes`. This causes Tandoor Recipes to create its `db.sqlite3` database file in the same directory as `MEDIA_ROOT` causing it to be accessible without authentication through HTTP like any other media file. This is the case when using `GUNICORN_MEDIA=1` or when using a web server like nginx to serve media files. NixOS 26.05 changes the default value of `MEDIA_ROOT` to a sub folder of the data directory. This only applies to configurations with `system.stateVersion` >= 26.05. For older configurations, one of the workarounds should be applied instead. NixOS 25.11 has received a backport of this patch, though it doesn't fix this vulnerability without user intervention. A recommended workaround is to move `MEDIA_ROOT` into a subdirectory. Non-recommended workarounds include switching to PostgreSQL or disallowing access to `db.sqlite3`.
📍 영향받는 시스템
Tandoor Recipes 23.05 ~ 26.04 (NixOS 기본 설정, SQLite 사용 시)
⚔️ 공격 벡터
HTTP GET 요청으로 /var/lib/tandoor-recipes/db.sqlite3 파일에 직접 접근 가능
🛡️ 대응 방법
NixOS 26.05로 업그레이드하거나 MEDIA_ROOT를 데이터 디렉토리 하위 폴더로 이동
🔧 검증 코드
SQLite 데이터베이스 파일에 접근 가능하면 취약하고, 접근 불가 또는 파일이 없으면 안전합니다.
curl -s http://localhost/var/lib/tandoor-recipes/db.sqlite3 | file - | grep -i sqlite && echo 'Vulnerable' || echo 'Not vulnerable'