🇰🇷 한글 설명
Network-AI의 EnvironmentManager.restore 함수에서 경로 탐색 취약점이 발견되었습니다. 공격자가 조작된 backupId를 사용하여 시스템의 임의 디렉토리에 있는 파일을 대상 환경 데이터 디렉토리로 복구할 수 있습니다. 이 문제는 v5.12.2에서 입력값 검증 및 경로 확인 로직을 통해 해결되었습니다.
💡 쉬운 설명
프로그램이 파일을 복구할 때 파일의 위치를 제대로 확인하지 않아 발생하는 문제입니다. 공격자가 특수하게 만든 이름을 입력하면 원래 허용된 폴더가 아닌 컴퓨터의 다른 중요한 폴더의 파일을 가져올 수 있습니다.
🇺🇸 원문 (English)
Network-AI is a TypeScript/Node.js multi-agent orchestrator. Prior to version 5.12.2, `EnvironmentManager.restore(env, backupId)` computes the backup path with `join(envDir, '.backups', backupId)` and only checks that this path exists. It does not resolve the result or verify that it remains under `data/<env>/.backups`. A caller can pass a traversal backup ID such as `../../../outside/source-dir` to restore files from an arbitrary directory into the target environment data directory. The issue is fixed in v5.12.2. `restore()` now validates `backupId` against `/^[\w\-]+$/` and asserts `dirname(resolve(join(backupsDir, backupId))) === resolve(backupsDir)` before touching the filesystem. Backup IDs containing path separators or `..` are rejected, so a crafted ID can no longer copy directories from outside `.backups/` into the environment.
📍 영향받는 시스템
Network-AI (v5.12.2 미만 버전)
⚔️ 공격 벡터
경로 탐색 문자열(예: ../..)이 포함된 조작된 backupId를 전달하여 임의의 디렉토리 파일에 접근
🛡️ 대응 방법
Network-AI를 v5.12.2 이상 버전으로 업데이트
🔧 검증 코드
출력된 버전이 5.12.2 이상인지 확인하여 취약점 해결 여부를 판단합니다.
npm list network-ai | grep -E 'network-ai@([0-5]\.[0-9]\.[0-9]|5\.12\.2)'