🇰🇷 한글 설명
Mongoose 임베디드 웹 서버의 mg_http_next_multipart() 함수에서 발생하는 취약점입니다. multipart 입력 처리 중 단일 CR 또는 LF 문자가 포함될 경우 헤더나 파일명, 경계값이 잘리는 현상이 발생하며, 이로 인해 공격자가 Content-Type을 조작하여 위험한 콘텐츠를 전달할 수 있습니다.
💡 쉬운 설명
웹 서버가 데이터를 읽을 때 줄바꿈 문자를 잘못 처리하여 데이터의 일부가 잘려 나가는 문제입니다. 이를 이용해 공격자는 마치 안전한 파일인 것처럼 속여서 위험한 파일을 서버에 업로드할 수 있습니다.
🇺🇸 원문 (English)
Mongoose is an embedded web server and network library. Prior to 7.22, a remote attacker can place a lone carriage return or line feed in multipart input processed by mg_http_next_multipart() in src/http.c. The loops comparing s[b] and s[b + 1], and s[h2] and s[h2 + 1], use an incorrect AND condition and stop when either character resembles part of a CRLF terminator. This truncates headers, filenames, or boundaries and can cause an application to accept dangerous content after seeing a misleading Content-Type value. This issue is fixed in version 7.22.
📍 영향받는 시스템
Mongoose version 7.22 미만 버전
⚔️ 공격 벡터
multipart 요청 데이터 내에 단일 CR 또는 LF 문자를 삽입하여 헤더 및 경계값 조작
🛡️ 대응 방법
Mongoose를 최신 버전인 7.22 이상으로 업데이트
🔧 검증 코드
소스 코드 내 해당 함수 존재 여부와 현재 설치된 Mongoose의 버전 정보를 확인하여 7.22 미만인지 판단합니다.
grep -r "mg_http_next_multipart" /path/to/mongoose/src/http.c && grep -E "version" /path/to/mongoose/README.md
📊 CVSS Vector String
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N
💻 영향받는 소프트웨어
IBM WebSphere Application Server