🇰🇷 한글 설명
.NET Core 및 Xamarin용 REST 라이브러리인 Refit의 헤더 관련 속성(Header, HeaderCollection, Authorize)에서 CRLF 인젝션 취약점이 발견되었습니다. HTTP 헤더 추가 시 CRLF 문자를 검증하지 않아 공격자가 추가 헤더를 삽입하거나 HTTP 요청을 스머글링할 수 있으며, 이는 SSRF로 이어질 수 있습니다.
💡 쉬운 설명
웹 통신을 도와주는 도구에서 입력값에 줄바꿈 문자가 포함되어도 이를 걸러내지 못하는 문제입니다. 이를 통해 해커가 몰래 가짜 명령을 끼워 넣어 서버를 속이거나 다른 곳으로 공격을 시도할 수 있습니다.
🇺🇸 원문 (English)
Refit is an automatic type-safe REST library for .NET Core, Xamarin and .NET The various header-related Refit attributes (Header, HeaderCollection and Authorize) are vulnerable to CRLF injection. The way HTTP headers are added to a request is via the `HttpHeaders.TryAddWithoutValidation` method. This method does not check for CRLF characters in the header value. This means that any headers added to a refit request are vulnerable to CRLF-injection. In general, CRLF-injection into a HTTP header (when using HTTP/1.1) means that one can inject additional HTTP headers or smuggle whole HTTP requests. If an application using the Refit library passes a user-controllable value through to a header, then that application becomes vulnerable to CRLF-injection. This is not necessarily a security issue for a command line application like the one above, but if such code were present in a web application then it becomes vulnerable to request splitting (as shown in the PoC) and thus Server Side Request Forgery. Strictly speaking this is a potential vulnerability in applications using Refit and not in Refit itself. This issue has been addressed in release versions 7.2.22 and 8.0.0 and all users are advised to upgrade. There are no known workarounds for this vulnerability.
📍 영향받는 시스템
Refit 라이브러리 7.2.22 및 8.0.0 미만 버전
⚔️ 공격 벡터
사용자 제어 가능한 값이 Refit의 HTTP 헤더 값으로 전달될 때 CRLF 문자를 삽입하여 공격
🛡️ 대응 방법
Refit 라이브러리를 7.2.22 또는 8.0.0 이상의 최신 버전으로 업그레이드
🔧 검증 코드
출력된 Refit의 버전이 7.2.22 또는 8.0.0보다 낮은지 확인
dotnet list package | grep Refit