🇰🇷 한글 설명
Node.js용 FTP 클라이언트인 basic-ftp 6.2.1 미만 버전에서 발생하는 취약점입니다. 악의적인 FTP 서버가 조작된 디렉토리 목록을 전송할 경우, 정규표현식의 백트래킹 문제로 인해 CPU 사용량이 급증하여 프로세스가 멈출 수 있습니다.
💡 쉬운 설명
나쁜 서버가 특수한 데이터를 보내면 컴퓨터가 이를 해석하느라 과도하게 힘을 써서 멈추게 만드는 공격입니다. 이로 인해 프로그램이 응답하지 않는 상태가 될 수 있습니다.
🇺🇸 원문 (English)
basic-ftp is an FTP client for Node.js. Prior to 6.2.1, Client.list() can be forced by a malicious or compromised FTP server to spend quadratic CPU time parsing a directory listing because the RE_LINE expression in src/parseListUnix.ts backtracks across adjacent variable-length owner and group fields when a long Unix-style line has a valid prefix but cannot satisfy the later size and date fields. parseList() selects a parser from the last nonblank line and then applies it to every line, so a normal final line can select the Unix parser while an earlier crafted line blocks the Node.js event loop and freezes the process. This issue is fixed in version 6.2.1.
📍 영향받는 시스템
basic-ftp version < 6.2.1
⚔️ 공격 벡터
악의적으로 조작된 디렉토리 목록을 전송하는 FTP 서버를 통한 서비스 거부(DoS) 공격
🛡️ 대응 방법
basic-ftp를 6.2.1 버전 이상으로 업데이트하십시오.
🔧 검증 코드
출력된 버전 번호가 6.2.1 미만이면 취약한 상태입니다.
npm list basic-ftp 2>/dev/null | grep -E 'basic-ftp@'